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 tekknolagi
Recipients Windson Yang, docs@python, tekknolagi
Date 2019-03-06.16:33:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CANZ2YWVq4xQ+=UUjD4NEJXN0RNnFdoa1wtZe6E-uVyt4E4SjJw@mail.gmail.com>
In-reply-to <1551871932.98.0.33354477409.issue36203@roundup.psfhosted.org>
Content
NewProxy checks if it's callable, so I suppose the code should be fixed.

On Wed, Mar 6, 2019, 03:32 Windson Yang <report@bugs.python.org> wrote:

>
> Windson Yang <wiwindson@outlook.com> added the comment:
>
> Yes, Maxwell. I guess the docs are misleading, the code locate in
> https://github.com/python/cpython/blob/master/Objects/weakrefobject.c#L748
>
> if (callback == Py_None)
>         callback = NULL;
>     if (callback == NULL)
>         /* return existing weak reference if it exists */
>         result = ref;
>     if (result != NULL)
>         Py_INCREF(result);
>     else {
>         ...
>     }
>
> However, I'm not sure we should fix the docs or the code here.
>
> ----------
> nosy: +Windson Yang
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue36203>
> _______________________________________
>
History
Date User Action Args
2019-03-06 16:33:20tekknolagisetrecipients: + tekknolagi, docs@python, Windson Yang
2019-03-06 16:33:19tekknolagilinkissue36203 messages
2019-03-06 16:33:19tekknolagicreate