- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
Issue17807
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.
Created on 2013-04-21 01:37 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| gen2.patch | pitrou, 2013-04-21 01:40 | review | ||
| gen3.patch | pitrou, 2013-04-21 02:30 | review | ||
| gen4.patch | pitrou, 2013-05-08 13:30 | review | ||
| Messages (9) | |||
|---|---|---|---|
| msg187482 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2013-04-21 01:37 | |
This experimental patch proposes to defer generator cleanup to the frame itself. In this scheme, the generator frame's tp_clear throws the GeneratorExit if necessary, so as to call cleanup code. The generator doesn't have any tp_del anymore, as it is now impossible to resurrect a generator (the frame, though, can be resurrected; I have to add a test for that). The net effect is that generators caught in a reference cycle can always be reclaimed, and their cleanup code is run in a valid frame. |
|||
| msg187485 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2013-04-21 02:30 | |
Patch with added tests. |
|||
| msg187491 - (view) | Author: Alyssa Coghlan (ncoghlan) * ![]() |
Date: 2013-04-21 04:44 | |
Just a couple of minor comments on review. Everything else I looked for (including the path where a generator failing to stop during frame deallocation leads to reporting an unraisable exception) seemed fine. One aspect I find interesting is that we've had other patches which proposed reducing the level of poking around generators needed to do inside frame objects by moving (some of) that state to the generators. This patch goes the other way, by moving the related cleanup functionality into the frame objects. I think that's actually a reasonable option - the frame is always going to be involved at some point in order to actually execute the cleanup code, so our only real chance to break the cycle is to eliminate the generator's involvement. |
|||
| msg188721 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2013-05-08 13:30 | |
Updated patch keeping PyGen_NeedsFinalizing() for backwards compatibility (always returning 0). |
|||
| msg188727 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2013-05-08 16:12 | |
New changeset c89febab4648 by Antoine Pitrou in branch 'default': Issue #17807: Generators can now be finalized even when they are part of a reference cycle. http://hg.python.org/cpython/rev/c89febab4648 |
|||
| msg188728 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2013-05-08 16:13 | |
Committing for now, we'll see what people say. |
|||
| msg189242 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2013-05-14 18:38 | |
New changeset edefd3450834 by Antoine Pitrou in branch 'default': Backout c89febab4648 following private feedback by Guido. http://hg.python.org/cpython/rev/edefd3450834 |
|||
| msg189243 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2013-05-14 18:40 | |
After getting some private feedback from Guido, I'm convinced this patch isn't ready for consumption. Objects visible from the frame when it is finalized can be in a weird, incomplete state (Guido reports failing to get the __class__ of an object, for instance). I'm keeping the issue open for now and will try to find further ways to solve the underlying problem. |
|||
| msg189511 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2013-05-18 12:35 | |
Obsoleted by PEP 442. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:44 | admin | set | github: 62007 |
| 2013-05-21 16:17:00 | pitrou | unlink | issue17934 dependencies |
| 2013-05-18 12:35:40 | pitrou | set | status: open -> closed resolution: rejected messages: + msg189511 |
| 2013-05-14 18:40:58 | pitrou | set | status: closed -> open resolution: fixed -> (no value) messages: + msg189243 stage: resolved -> |
| 2013-05-14 18:38:02 | python-dev | set | messages: + msg189242 |
| 2013-05-10 17:39:50 | pitrou | link | issue17468 superseder |
| 2013-05-08 16:13:23 | pitrou | set | status: open -> closed resolution: fixed messages: + msg188728 stage: patch review -> resolved |
| 2013-05-08 16:12:46 | python-dev | set | nosy:
+ python-dev messages: + msg188727 |
| 2013-05-08 13:30:42 | pitrou | set | files:
+ gen4.patch messages: + msg188721 |
| 2013-05-08 11:54:18 | pitrou | link | issue17934 dependencies |
| 2013-04-21 08:44:11 | pconnell | set | nosy:
+ pitrou |
| 2013-04-21 08:22:21 | pconnell | set | nosy:
+ pconnell, isoschiz, - pitrou |
| 2013-04-21 04:48:14 | ncoghlan | link | issue17800 superseder |
| 2013-04-21 04:44:58 | ncoghlan | set | messages: + msg187491 |
| 2013-04-21 02:30:02 | pitrou | set | files:
+ gen3.patch messages: + msg187485 |
| 2013-04-21 01:40:48 | pitrou | set | files: + gen2.patch |
| 2013-04-21 01:40:41 | pitrou | set | files: - gen2.patch |
| 2013-04-21 01:37:31 | pitrou | create | |



