Windson Yang <wiwind...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue36203>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to