This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients dewin, r.david.murray
Date 2014-01-06.19:44:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389037465.59.0.681978660042.issue20149@psf.upfronthosting.co.za>
In-reply-to
Content
"magic methods" like __enter__ and __exit__ are only looked up on the class, not on the instance.  This is by design.

In some older versions of Python some specific methods (and I think __enter__ and __exit__ were among them for a time) were looked up on the instances, but this was a bug.

(Personally I think it would be nice if they were looked up on the instances, but there are good reasons why this is not done.)
History
Date User Action Args
2014-01-06 19:44:25r.david.murraysetrecipients: + r.david.murray, dewin
2014-01-06 19:44:25r.david.murraysetmessageid: <1389037465.59.0.681978660042.issue20149@psf.upfronthosting.co.za>
2014-01-06 19:44:25r.david.murraylinkissue20149 messages
2014-01-06 19:44:25r.david.murraycreate