[issue30469] Inconsistent Execution of Generic Descriptor Attributes

Eryk Sun report at bugs.python.org
Wed May 24 23:14:02 EDT 2017


Eryk Sun added the comment:

It looks like slot_tp_descr_get bypasses call_method in order to unset tp->tp_descr_get for descriptors that don't define __get__. I don't know where that's an issue. If a class doesn't define __get__, its tp_descr_get slot should already be NULL. 

That said, I don't see why it's calling _PyType_LookupId directly instead of lookup_maybe. Using lookup_maybe would bind __get__ if it's a descriptor, and we want that, no? Then slot_tp_descr_get wouldn't have to manually hack `self` into the call, which is wrong in this case.

----------
components: +Interpreter Core -ctypes
nosy: +eryksun
versions: +Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30469>
_______________________________________


More information about the Python-bugs-list mailing list