mirror of
https://github.com/python/cpython.git
synced 2025-08-25 19:24:42 +00:00
gh-119180: PEP 649 compiler changes (#119361)
This commit is contained in:
parent
02c1dfff07
commit
9b8611eeea
28 changed files with 610 additions and 329 deletions
|
@ -220,13 +220,7 @@ def get_annotations(obj, *, globals=None, locals=None, eval_str=False):
|
|||
"""
|
||||
if isinstance(obj, type):
|
||||
# class
|
||||
obj_dict = getattr(obj, '__dict__', None)
|
||||
if obj_dict and hasattr(obj_dict, 'get'):
|
||||
ann = obj_dict.get('__annotations__', None)
|
||||
if isinstance(ann, types.GetSetDescriptorType):
|
||||
ann = None
|
||||
else:
|
||||
ann = None
|
||||
ann = obj.__annotations__
|
||||
|
||||
obj_globals = None
|
||||
module_name = getattr(obj, '__module__', None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue