Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Bug report
Bug description:
from __future__importannotationsimportannotationlibclassA:a:intA.__annotations__= {"a":str}print(A.__annotations__)print(annotationlib.get_annotations(A))
this works in 3.14.0a7, has no effect in 3.14.0b1. there seems to be a new attribute__annotations_cache__ that the assignment goes into but it isn't returned from__annotations__:
# 3.14.0a7$ ~/.venv314a7/bin/python test4.py {'a': <class 'str'>}{'a': <class 'str'>}# 3.14.0b1$ ~/.venv314/bin/python test4.py {'a': 'int'}{'a': 'int'}If there's a way to get annotationlib.get_annotations() to pick up the change I can use that as a workaround
CPython versions tested on:
3.14
Operating systems tested on:
No response