Maxwell Bernstein <tekk.nol...@gmail.com> added the comment:
NewProxy checks if it's callable, so I suppose the code should be fixed. On Wed, Mar 6, 2019, 03:32 Windson Yang <rep...@bugs.python.org> wrote: > > 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 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