Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1351
(An Untitled Masterwork)
Active
Public
Actions
Authored by
vlorentz
on Apr 26 2022, 11:54 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
$ cat example.py
import contextlib
@contextlib.contextmanager
def f():
print("start f")
yield
print("end f")
print("before")
with f():
print("inside")
print("after")
$ python3 example.py
before
start f
inside
end f
after
Event Timeline
vlorentz
created this paste.
Apr 26 2022, 11:54 AM
2022-04-26 11:54:27 (UTC+2)
Log In to Comment