←back to thread

49 points emailed | 1 comments | | HN request time: 0.228s | source
Show context
wrcwill ◴[] No.45904737[source]
Unless I'm missing something, this has nothing to do with asynchronous code. The delete is just synchronous code running, same as if we called a function/closure right there.

This is just about syntax sugar hiding function calls.

replies(2): >>45905113 #>>45905158 #
1. ltratt ◴[] No.45905158[source]
I'm assuming you're referring to the Python finaliser example? If so, there's no syntax sugar hiding function calls to finalisers: you can verify that by running the code on PyPy, where the point at which the finaliser is called is different. Indeed, for this short-running program, the most likely outcome is that PyPy won't call the finaliser before the program completes!