top | item 44012996

(no title)

havkom | 9 months ago

Reminds me of C#.. IDisposible and IAsyncDisposible in C# helps a lot to write good mechanisms for things that should actually be abstracted in a nice way (such as locks handling, queue mechanisms, temporary scopes for impersonation, etc).

discuss

order

pwdisswordfishz|9 months ago

spankalee|9 months ago

That looks like a lot of very reasonable responses to me.

masklinn|9 months ago

It's basically lifted from C#'s, the original proposal makes no secret of it and cites all of Python's context managers, Java's try with resources, C#'s using statements, and C#'s using declarations. And `using` being the keyword and `dispose` the hook method is a pretty big hint.