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

前端 未结 5 863
不思量自难忘°
不思量自难忘° 2020-12-06 05:09

What\'s the equivalent of this in IronPython? Is it just a try-finally block?

using (var something = new ClassThatImp         


        
5条回答
  •  被撕碎了的回忆
    2020-12-06 05:40

    IronPython (as of the 2.6 release candidates) supports the with statement, which wraps an IDisposable object in a manner similar to using.

提交回复
热议问题