Author eric.araujo
Recipients LambertDW, eric.araujo
Date 2011-10-17.16:03:30
SpamBayes Score 0.00205808
Marked as misclassified No
Message-id <1318867411.47.0.797862773.issue13202@psf.upfronthosting.co.za>
In-reply-to
Content
To clarify: Python 2.5 and higher support the with statement syntax, but not all classes that could benefit from it have the __enter__ and __exit__ methods.  So you don’t get a SyntaxError in Python 2.7 when you write “with Popen(...)”, but you get an AttributeError because Popen in 2.7 does not do its part to support context management.  The built-in open function, on the contrary, supports with in 2.5 and higher.
History
Date User Action Args
2011-10-17 16:03:31eric.araujosetrecipients: + eric.araujo, LambertDW
2011-10-17 16:03:31eric.araujosetmessageid: <1318867411.47.0.797862773.issue13202@psf.upfronthosting.co.za>
2011-10-17 16:03:30eric.araujolinkissue13202 messages
2011-10-17 16:03:30eric.araujocreate