Author eric.araujo
Recipients benjamin.peterson, daniel.urban, dholth, eric.araujo
Date 2011-05-23.14:09:44
SpamBayes Score 0.0028053
Marked as misclassified No
Message-id <1306159785.5.0.952118645579.issue12022@psf.upfronthosting.co.za>
In-reply-to
Content
> hasattr(transaction, '__exit__')

http://docs.python.org/dev/reference/datamodel#special-method-names explains that magic methods are looked up on the class, not on the instances.  There’s a lot of code out there that erroneously checks for __len__ or __call__ on instances, and this is the second time to my knowledge that a project abused a module-level __enter__ function.
History
Date User Action Args
2011-05-23 14:09:45eric.araujosetrecipients: + eric.araujo, benjamin.peterson, daniel.urban, dholth
2011-05-23 14:09:45eric.araujosetmessageid: <1306159785.5.0.952118645579.issue12022@psf.upfronthosting.co.za>
2011-05-23 14:09:44eric.araujolinkissue12022 messages
2011-05-23 14:09:44eric.araujocreate