Resource management (aka context manager, with statement, using statement)

50 views
Skip to first unread message

Pat Kujawa

unread,
Sep 9, 2016, 8:41:53 PM9/9/16
to Dart Core Development
I'm new to Dart, but I was surprised to find no mechanism that is the equivalent of .NET's [using Statement](https://msdn.microsoft.com/en-us/library/yh598w02.aspx) or Python's [`with` Statement](https://www.python.org/dev/peps/pep-0343/) / [context manager](https://docs.python.org/dev/library/contextlib.html) for doing resource management. Am I mistaken? If not, is this request worthy of a DEP?

Brian Slesinsky

unread,
Sep 9, 2016, 8:59:47 PM9/9/16
to Pat Kujawa, Dart Core Development
Hard to say. We do have the "finally" clause, and it works with async I/O.


On Fri, Sep 9, 2016 at 1:35 PM, Pat Kujawa <pat.k...@workiva.com> wrote:
I'm new to Dart, but I was surprised to find no mechanism that is the equivalent of .NET's [using Statement](https://msdn.microsoft.com/en-us/library/yh598w02.aspx) or Python's [`with` Statement](https://www.python.org/dev/peps/pep-0343/) / [context manager](https://docs.python.org/dev/library/contextlib.html) for doing resource management. Am I mistaken? If not, is this request worthy of a DEP?

--
You received this message because you are subscribed to the Google Groups "Dart Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to core-dev+unsubscribe@dartlang.org.

Dev Aggarwal

unread,
Jul 10, 2018, 12:16:27 PM7/10/18
to Dart Core Development
+1 This would nice to have
Reply all
Reply to author
Forward
0 new messages