gh-109818: reprlib.recursive_repr copies __type_params__ (#109819)

This commit is contained in:
Nikita Sobolev 2023-09-28 05:26:42 +03:00 committed by GitHub
parent 5bb6f0fcba
commit f65f9e80fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -29,6 +29,7 @@ def recursive_repr(fillvalue='...'):
wrapper.__name__ = getattr(user_function, '__name__')
wrapper.__qualname__ = getattr(user_function, '__qualname__')
wrapper.__annotations__ = getattr(user_function, '__annotations__', {})
wrapper.__type_params__ = getattr(user_function, '__type_params__', ())
wrapper.__wrapped__ = user_function
return wrapper