MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/z4aic2/defer_in_python/ixrnfkq/?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
11
no matter what
Unless you lose power, or the process is SIGKILLed. It's important to remember this if you're handling resources that exist outside of your process.
52 u/rebane2001 Nov 25 '22 That's why I always wrap my wall outlet in a try/finally block 1 u/nxtfari Nov 25 '22 Maybe dumb question can you just pair it with signal/atexit to cover all possible cases?edit: ah i think you would have to have a seperate process to do this. You can atexit for SIGTERM but not SIGKILL
52
That's why I always wrap my wall outlet in a try/finally block
1
Maybe dumb question can you just pair it with signal/atexit to cover all possible cases?
edit: ah i think you would have to have a seperate process to do this. You can atexit for SIGTERM but not SIGKILL
View all comments
Show parent comment
11
u/rcfox Nov 25 '22
Unless you lose power, or the process is SIGKILLed. It's important to remember this if you're handling resources that exist outside of your process.