New submission from Christian Heimes <li...@cheimes.de>:

While I was working on a patch to port wrapt to limited API and stable ABI, I 
noticed a possible regression in __annotations__ PyGetSetDef. It looks like C 
heap type subclasses no longer inherit the __annotations__ descriptor from a C 
heap type parent class. A gdb session confirmed that 3.10 no longer calls the 
WraptObjectProxy_set_annotations setter of the parent class while 3.9 does.

I had to add 

    { "__annotations__",    (getter)WraptObjectProxy_get_annotations,
                            (setter)WraptObjectProxy_set_annotations, 0},

to PyGetSetDef of the child class in order to fix the behavior. Python 3.9 and 
older work as expected.

You can reproduce the behavior by disabling WRAPT_ANNOTATIONS_GETSET_WORKAROUND 
and run "tox -e py310-install-extensions". The PR is 
https://github.com/GrahamDumpleton/wrapt/pull/187.

----------
components: C API
keywords: 3.10regression
messages: 402855
nosy: christian.heimes, pablogsal
priority: normal
severity: normal
stage: test needed
status: open
title: Possible regression in __annotations__ descr for heap type subclasses
type: behavior
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45319>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to