
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2014-07-31 17:51 bypitrou, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| 22116.patch | kilowu,2014-08-02 12:51 | review | ||
| Messages (10) | |||
|---|---|---|---|
| msg224432 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2014-07-31 17:51 | |
Currently, it is not possible to take a weakref to a PyCFunction object. However, those objects already have full GC support, so it wouldn't be silly to add weakref support to them.(this came in the context of numba, which generates such C functions on-the-fly) | |||
| msg224541 -(view) | Author: Stefan Behnel (scoder)*![]() | Date: 2014-08-02 08:37 | |
FWIW, functions in Cython (which C-level-inherit from PyCFunction) support weak references just fine. Adding that as a general feature to PyCFunction sounds like the right thing to do. | |||
| msg224558 -(view) | Author: Wei Wu (kilowu)* | Date: 2014-08-02 12:49 | |
I have made a patch related to this issue, please take a look at it. Thanks :) | |||
| msg224561 -(view) | Author: Stefan Behnel (scoder)*![]() | Date: 2014-08-02 13:19 | |
Patch looks ok. Not sure about the test dependency from test_weakref.py to _testcapi, though. Is that module allowed to be used everywhere? Wouldn't it be enough to test that one of the builtin functions is now weak referencible? "len" seems to be used in other places, for example. | |||
| msg224641 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2014-08-03 14:57 | |
> Wouldn't it be enough to test that one of the builtin functions is now weak referencible?It's better to check that the weakref gets cleared when the object dies, and for that you need an object you can dispose of. | |||
| msg224675 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2014-08-04 02:41 | |
@kilowu, your patch looks good to me. As a necessary step to include your contribution, could you please sign the contributor's agreement? Seehttps://www.python.org/psf/contrib/contrib-form/Thank you very much! | |||
| msg224692 -(view) | Author: Wei Wu (kilowu)* | Date: 2014-08-04 07:20 | |
@pitrou, thank you for the review. I have signed the contributor agreement form after submitting this patch. Please let me know if there is a further step to help you to verify the signed contributor agreement.I'm really glad to have the chance to contribute back to the community. | |||
| msg224738 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2014-08-04 15:45 | |
Ah, yes, indeed, the agreement seems to have been validated in the meantime (you can see it by the asterisk near your name in the comments here). Thank you! | |||
| msg224974 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2014-08-06 23:34 | |
New changeset87f940e85cb0 by Antoine Pitrou in branch 'default':Issue#22116: C functions and methods (of the 'builtin_function_or_method' type) can now be weakref'ed. Patch by Wei Wu.http://hg.python.org/cpython/rev/87f940e85cb0 | |||
| msg224975 -(view) | Author: Antoine Pitrou (pitrou)*![]() | Date: 2014-08-06 23:36 | |
I have committed your patch. Thank you very much for contributing! | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:06 | admin | set | github: 66314 |
| 2014-08-06 23:36:29 | pitrou | set | status: open -> closed resolution: fixed messages: +msg224975 stage: patch review -> resolved |
| 2014-08-06 23:34:49 | python-dev | set | nosy: +python-dev messages: +msg224974 |
| 2014-08-04 15:45:14 | pitrou | set | messages: +msg224738 |
| 2014-08-04 07:20:58 | kilowu | set | messages: +msg224692 |
| 2014-08-04 02:41:55 | pitrou | set | messages: +msg224675 |
| 2014-08-04 02:35:17 | pitrou | set | stage: test needed -> patch review |
| 2014-08-03 14:57:44 | pitrou | set | messages: +msg224641 |
| 2014-08-02 13:19:48 | scoder | set | messages: +msg224561 |
| 2014-08-02 12:51:14 | kilowu | set | files: +22116.patch keywords: +patch |
| 2014-08-02 12:49:37 | kilowu | set | nosy: +kilowu messages: +msg224558 |
| 2014-08-02 08:37:42 | scoder | set | nosy: +scoder messages: +msg224541 |
| 2014-08-02 08:01:04 | Anthony.Kong | set | nosy: +Anthony.Kong |
| 2014-08-01 10:46:28 | ezio.melotti | set | nosy: +ezio.melotti stage: test needed |
| 2014-07-31 20:14:34 | pitrou | set | keywords: +easy |
| 2014-07-31 17:51:31 | pitrou | create | |