Formatting fixes in contextlib docs (GH-98111)

(cherry picked from commit 3b33c2010a)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-10-11 21:05:12 -07:00 committed by GitHub
parent 9e666bc640
commit 59ddbc4ab6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,6 +66,8 @@ Functions and classes provided:
# Code to release resource, e.g.:
release_resource(resource)
The function can then be used like this::
>>> with managed_resource(timeout=3600) as resource:
... # Resource is released at the end of this block,
... # even if code in the block raises an exception
@ -396,6 +398,8 @@ Functions and classes provided:
print('Finishing')
return False
The class can then be used like this::
>>> @mycontext()
... def function():
... print('The bit in the middle')
@ -466,6 +470,8 @@ Functions and classes provided:
print('Finishing')
return False
The class can then be used like this::
>>> @mycontext()
... async def function():
... print('The bit in the middle')