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 barry
Recipients Denaun, barry, docs@python, ncoghlan
Date 2017-12-11.00:54:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512953655.85.0.213398074469.issue32145@psf.upfronthosting.co.za>
In-reply-to
Content
I wasn't even aware that pop_all() tries to create the concrete subtype.  I wonder how common subclassing ExitStack is in practice.  (Of course, the answer is that we'll never know.)

For 3.7, we should probably delegate instance creation to a new non-private method, e.g.

    new_stack = self._make_instance()

so *if* you subclass, you can create the new ExitStack subclass instances any way you want.  I would then change the default implementation to make an ExitStack() explicitly, as per the current documentation.

+1 for fixing the recipe and not changing the code for 3.6.  You might want to add a note describing the current behavior for <= 3.6 and indicating that this will change for 3.7+

Finally, while you're at it, is there any reason not to change the recipe to use:

    super().__init__()

instead?
History
Date User Action Args
2017-12-11 00:54:15barrysetrecipients: + barry, ncoghlan, docs@python, Denaun
2017-12-11 00:54:15barrysetmessageid: <1512953655.85.0.213398074469.issue32145@psf.upfronthosting.co.za>
2017-12-11 00:54:15barrylinkissue32145 messages
2017-12-11 00:54:15barrycreate