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 ysj.ray
Recipients michael.foord, ncoghlan, pitrou, ysj.ray
Date 2011-03-29.14:23:57
SpamBayes Score 1.164121e-09
Marked as misclassified No
Message-id <1301408639.94.0.683340024863.issue11647@psf.upfronthosting.co.za>
In-reply-to
Content
> For 3.3, the fix could be generalised with ContextDecorator supporting a documented "self._recreate" internal interface that, by default, just returns self, but would be overridden in _GeneratorContextManager to actually create a new instance. The custom __call__ implementation for _GeneratorContextManager could then be removed.

How about directly using the existing "copy.copy()" semantics instead of self._recreate()? That is, call "with copy.copy(self)" instead of "with self" in ContextGenerator.__call__(), implement ContextGenerator.__copy__() method to simply return self, and implement  _GeneratorContextManager.__copy__() to create a copy of itself. This saves an internal interface.
History
Date User Action Args
2011-03-29 14:24:00ysj.raysetrecipients: + ysj.ray, ncoghlan, pitrou, michael.foord
2011-03-29 14:23:59ysj.raysetmessageid: <1301408639.94.0.683340024863.issue11647@psf.upfronthosting.co.za>
2011-03-29 14:23:57ysj.raylinkissue11647 messages
2011-03-29 14:23:57ysj.raycreate