MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/z4aic2/defer_in_python/ixr1vs5/?context=3
r/Python • u/dankey26 • Nov 25 '22
https://github.com/dankeyy/defer.py
stupid but works lol hope you like it
62 comments sorted by
View all comments
Show parent comment
2
Python has context managers for that:
with open('file.txt') as f: #do stuff #when done f will be closed by context manager
View all comments
Show parent comment
2
u/fiedzia Nov 25 '22
Python has context managers for that:
with open('file.txt') as f: #do stuff #when done f will be closed by context manager