@@ -312,7 +312,9 @@ mean.
312312This is often a challenging rule to follow – for example, the call
313313soon code has to jump through some hoops to make it happen – but its
314314most dramatic influence can seen in Trio's task-spawning interface,
315- where it motivates the use of "nurseries"::
315+ where it motivates the use of "nurseries":
316+
317+ .. code-block :: python
316318
317319 async def parent ():
318320 async with trio.open_nursery() as nursery:
@@ -376,18 +378,22 @@ Specific style guidelines
376378 unconditionally act as cancel+schedule points.
377379
378380* Any function that takes a callable to run should have a signature
379- like::
381+ like:
382+
383+ .. code-block :: python
380384
381- def call_the_thing(fn, *args, kwonly1, kwonly2, ...): :
385+ def call_the_thing (fn , * args , kwonly1 , kwonly2 ) :
382386 ...
383387
384388 where ``fn(*args) `` is the thing to be called, and ``kwonly1 ``,
385- ``kwonly2 ``, ... are keyword-only arguments that belong to
389+ ``kwonly2 ``, are keyword-only arguments that belong to
386390 ``call_the_thing ``. This applies even if ``call_the_thing `` doesn't
387391 take any arguments of its own, i.e. in this case its signature looks
388- like::
392+ like:
389393
390- def call_the_thing(fn, *args)::
394+ .. code-block :: python
395+
396+ def call_the_thing (fn , * args ):
391397 ...
392398
393399 This allows users to skip faffing about with
@@ -410,12 +416,14 @@ Specific style guidelines
410416 worse, and you get used to the convention pretty quick.
411417
412418* If it's desirable to have both blocking and non-blocking versions of
413- a function, then they look like::
419+ a function, then they look like:
420+
421+ .. code-block :: python
414422
415- async def OPERATION(... ):
423+ async def OPERATION (arg1 , arg2 ):
416424 ...
417425
418- def OPERATION_nowait(... ):
426+ def OPERATION_nowait (arg1 , arg2 ):
419427 ...
420428
421429 and the ``nowait `` version raises :exc: `trio.WouldBlock ` if it would block.
0 commit comments