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月16日 19:11 by mark.dickinson, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| no_weakref_kwargs.patch | georg.brandl, 2013年10月14日 14:43 | review | ||
| no_weakref_kwargs_2.patch | georg.brandl, 2013年10月14日 15:37 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg187115 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2013年04月16日 19:11 | |
Passing a weakref.ref callback by keyword currently fails silently:
Python 3.4.0a0 (default:537c1f1ab53c, Apr 16 2013, 20:07:47)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import weakref
>>> weakref.ref({1, 2, 3}, callback=lambda ref:print("collected"))
<weakref at 0x1006189d8; dead>
For Python 3.4, I'd suggest that either (1) this should be an exception, or (2) it should be permissible to pass the callback by keyword.
|
|||
| msg199898 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2013年10月14日 14:43 | |
See attached patch, it handles this like all other builtins that don't support keyword arguments in their constructor. |
|||
| msg199904 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2013年10月14日 15:07 | |
Why the PyWeakref_Check() in your patch? |
|||
| msg199909 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2013年10月14日 15:35 | |
Good point, that is pointless in __init__(). |
|||
| msg264954 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年05月06日 09:40 | |
no_weakref_kwargs_2.patch LGTM. |
|||
| msg265056 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2016年05月07日 09:41 | |
Serhiy, feel free to go ahead and commit, I don't have my keys with me ATM. |
|||
| msg265062 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年05月07日 12:44 | |
New changeset ee17a83feabc by Serhiy Storchaka in branch '3.5': Issue #17765: weakref.ref() no longer silently ignores keyword arguments. https://hg.python.org/cpython/rev/ee17a83feabc New changeset 60de9c6188cc by Serhiy Storchaka in branch '2.7': Issue #17765: weakref.ref() no longer silently ignores keyword arguments. https://hg.python.org/cpython/rev/60de9c6188cc New changeset ef55fa8c4b82 by Serhiy Storchaka in branch 'default': Issue #17765: weakref.ref() no longer silently ignores keyword arguments. https://hg.python.org/cpython/rev/ef55fa8c4b82 |
|||
| msg265063 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年05月07日 12:47 | |
Done. This issue is similar to recently closed issue26822. Please give me know if you have other ready to review patches. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:44 | admin | set | github: 61965 |
| 2016年05月07日 12:48:00 | serhiy.storchaka | set | status: open -> closed resolution: fixed messages: + msg265063 stage: commit review -> resolved |
| 2016年05月07日 12:44:33 | python-dev | set | nosy:
+ python-dev messages: + msg265062 |
| 2016年05月07日 09:41:05 | georg.brandl | set | messages: + msg265056 |
| 2016年05月07日 05:51:24 | serhiy.storchaka | set | assignee: georg.brandl |
| 2016年05月06日 09:40:28 | serhiy.storchaka | set | type: enhancement -> behavior components: + Extension Modules versions: + Python 3.5, Python 3.6, - Python 3.3, Python 3.4 nosy: + serhiy.storchaka messages: + msg264954 stage: needs patch -> commit review |
| 2013年10月14日 15:37:24 | georg.brandl | set | files: + no_weakref_kwargs_2.patch |
| 2013年10月14日 15:35:20 | georg.brandl | set | messages: + msg199909 |
| 2013年10月14日 15:07:19 | pitrou | set | messages: + msg199904 |
| 2013年10月14日 14:43:54 | georg.brandl | set | files:
+ no_weakref_kwargs.patch versions: + Python 2.7, Python 3.3 nosy: + georg.brandl, pitrou messages: + msg199898 keywords: + patch |
| 2013年04月16日 19:11:10 | mark.dickinson | create | |