Message308011
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? |
|
Date |
User |
Action |
Args |
2017-12-11 00:54:15 | barry | set | recipients:
+ barry, ncoghlan, docs@python, Denaun |
2017-12-11 00:54:15 | barry | set | messageid: <1512953655.85.0.213398074469.issue32145@psf.upfronthosting.co.za> |
2017-12-11 00:54:15 | barry | link | issue32145 messages |
2017-12-11 00:54:15 | barry | create | |
|