[issue36203] PyWeakref_NewRef docs are misleading

2021-05-20 Thread Maxwell Bernstein
Change by Maxwell Bernstein : -- pull_requests: +24879 pull_request: https://github.com/python/cpython/pull/26273 ___ Python tracker ___

[issue36203] PyWeakref_NewRef docs are misleading

2021-05-20 Thread Irit Katriel
Irit Katriel added the comment: Please add unit tests to the patch. -- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-08 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12232 stage: -> patch review ___ Python tracker ___ ___

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-07 Thread Maxwell Bernstein
Maxwell Bernstein added the comment: I can likely do it tomorrow. If not I'll update this. On Thu, Mar 7, 2019, 00:20 Windson Yang wrote: > > Windson Yang added the comment: > > It looks to me the fix is easy, we just will return NULL and raise > TypeError when the callback is not

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-07 Thread Windson Yang
Windson Yang added the comment: It looks to me the fix is easy, we just will return NULL and raise TypeError when the callback is not callable, None, or NULL. I'm not an expert in C, but I would love to create a PR for it if you don't have time. --

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-06 Thread Maxwell Bernstein
Maxwell Bernstein 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 wrote: > > Windson Yang added the comment: > > Yes, Maxwell. I guess the docs are misleading, the code locate in >

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-06 Thread Windson Yang
Windson Yang 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

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-05 Thread SilentGhost
Change by SilentGhost : -- assignee: -> docs@python components: +Documentation, ctypes nosy: +docs@python type: -> behavior ___ Python tracker ___

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-05 Thread Maxwell Bernstein
New submission from Maxwell Bernstein : The docs for `PyWeakref_NewRef` state "if callback is not callable, None, or NULL, this will return NULL and raise TypeError". It does not appear as though there is a callable check for the callback. -- messages: 337255 nosy: Maxwell Bernstein