MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/z4aic2/defer_in_python/ixrokzc/?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
4
It is occasionally useful, if you need to close a large or variable number of things in a block of code. Fortunately, contextlib.ExitStack is already in the stdlib and is a less evil way to do this.
contextlib.ExitStack
View all comments
Show parent comment
4
u/james_pic Nov 25 '22
It is occasionally useful, if you need to close a large or variable number of things in a block of code. Fortunately,
contextlib.ExitStackis already in the stdlib and is a less evil way to do this.