gh-132261: Store annotations at hidden internal keys in the class dict (#132345)

This commit is contained in:
Jelle Zijlstra 2025-04-10 21:13:26 -07:00 committed by GitHub
parent e5f68fd29b
commit 07b8d3117f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 100 additions and 52 deletions

View file

@ -330,7 +330,8 @@ def visiblename(name, all=None, obj=None):
'__date__', '__doc__', '__file__', '__spec__',
'__loader__', '__module__', '__name__', '__package__',
'__path__', '__qualname__', '__slots__', '__version__',
'__static_attributes__', '__firstlineno__'}:
'__static_attributes__', '__firstlineno__',
'__annotate_func__', '__annotations_cache__'}:
return 0
# Private names are hidden, but special names are displayed.
if name.startswith('__') and name.endswith('__'): return 1