Match formatting of other recursive types

This commit is contained in:
James 2021-08-01 19:01:55 +01:00 committed by GitHub
parent a30f2b99c3
commit d480447cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,7 +122,7 @@ def restify(cls: Optional[Type]) -> str:
return ' | '.join(restify(a) for a in cls.__args__)
elif cls.__module__ in ('__builtin__', 'builtins'):
if hasattr(cls, '__args__'):
return ':class:`%s`\\[%s]' % (cls.__name__, ', '.join(restify(arg) for arg in cls.__args__))
return ':class:`%s`\\ [%s]' % (cls.__name__, ', '.join(restify(arg) for arg in cls.__args__))
else:
return ':class:`%s`' % cls.__name__
else: