Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
fromfunctoolsimportupdate_wrapperdefmy_type(*args):passt=update_wrapper(my_type,type)
This works on Python ≤ 3.11, and I think this is expected because the docs forupdate_wrapper claim that it may be used with callables other than functions.
However, with 3.12, I get
TypeError: __type_params__ must be set to a tuple(Similarly forfunctools.wraps.)
The problem is that update_wrapper includes__type_params__ by default (which is undocumented, seerelated issue) andtype.__type_params__ is a descriptor.
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
- gh-119011:
type.__type_params__now return an empty tuple #119296 - gh-119011: Return an empty tuple on type_get_type_params as special case for PyType_Type #119313
- [3.13] gh-119011:
type.__type_params__now return an empty tuple (GH-119296) #119678 - [3.12] gh-119011:
type.__type_params__now return an empty tuple (GH-119296) #119681