classification
Title: functools.partial missing __weakref__ descriptor?
Type: behavior Stage:
Components: Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: bup, rhettinger
Priority: normal Keywords:

Created on 2021-02-27 18:37 by bup, last changed 2021-02-27 21:15 by rhettinger.

Messages (1)
msg387781 - (view) Author: Dan Snider (bup) * Date: 2021-02-27 18:37
The only way to lookup weak references to functools.partial objects is with weakref.getweakrefs. I don't know if it's normal for extension types that define tp_weaklistoffset to not add a __weakref__ descriptor, but I figured at the very least a subtype specifying "__weakref__" in its __slots__ could get one. Instead, it fails with the partially true TypeError: __weakref__ slot disallowed: either we already got one, or __itemsize__ != 0.
History
Date User Action Args
2021-02-27 21:15:12rhettingersetnosy: + rhettinger
2021-02-27 18:37:25bupcreate