What is the equivalent of the C# "using" block in IronPython?

idisposable, ironpython

Solution

IronPython supports using `IDisposable` with `with` statement, so you can write something like this:

with ClassThatImplementsIDisposable() as something:
    pass

Problem

What's the equivalent of this in IronPython? Is it just a try-finally block? ``` using (var something = new ClassThatImplementsIDisposable()) { // stuff happens here } ```

Original source