File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -517,9 +517,8 @@ def _type_repr(obj):
517
517
518
518
Copied from :mod:`typing` since collections.abc
519
519
shouldn't depend on that module.
520
+ (Keep this roughly in sync with the typing version.)
520
521
"""
521
- if isinstance (obj , GenericAlias ):
522
- return repr (obj )
523
522
if isinstance (obj , type ):
524
523
if obj .__module__ == 'builtins' :
525
524
return obj .__qualname__
Original file line number Diff line number Diff line change @@ -230,6 +230,9 @@ def _type_repr(obj):
230
230
typically enough to uniquely identify a type. For everything
231
231
else, we fall back on repr(obj).
232
232
"""
233
+ # When changing this function, don't forget about
234
+ # `_collections_abc._type_repr`, which does the same thing
235
+ # and must be consistent with this one.
233
236
if isinstance (obj , type ):
234
237
if obj .__module__ == 'builtins' :
235
238
return obj .__qualname__
You can’t perform that action at this time.
0 commit comments