At 05:20 PM 4/25/2006 -0700, Guido van Rossum wrote: >I would augment #1 to clarify that if you have __enter__ and __exit__ >you may not have __context__ at all; if you have all three, >__context__ must return self.
Well, requiring the __context__ allows us to ditch the otherwise complex problem of why @contextfactory functions' return value is usable by "with", without having to explain it separately. So, I don't think there's any reason to provide an option; there should be Only One Way To Do It. Well, actually, two. That is, you can have one method or all three. Two is right out. :) (ObMontyPython: Wait, I'll come in again...) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com