Message403759
It looks like the error is in inspect.formatannotation().
For instances of type, that function incorrectly returns only annotation.__qualname__.
Instead, it should return repr(annotation) which would include the args.
=================================================================
def formatannotation(annotation, base_module=None):
if getattr(annotation, '__module__', None) == 'typing':
return repr(annotation).replace('typing.', '')
if isinstance(annotation, type): # <== Erroneous case
if annotation.__module__ in ('builtins', base_module):
return annotation.__qualname__
return annotation.__module__+'.'+annotation.__qualname__
return repr(annotation) |
|
Date |
User |
Action |
Args |
2021-10-12 21:40:49 | rhettinger | set | recipients:
+ rhettinger, gvanrossum, levkivskyi, kj |
2021-10-12 21:40:49 | rhettinger | set | messageid: <1634074849.62.0.110656317403.issue45438@roundup.psfhosted.org> |
2021-10-12 21:40:49 | rhettinger | link | issue45438 messages |
2021-10-12 21:40:49 | rhettinger | create | |
|