-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
from functools import update_wrapper
def my_type(*args): pass
t = update_wrapper(my_type, type)This works on Python ≤ 3.11, and I think this is expected because the docs for update_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 for functools.wraps.)
The problem is that update_wrapper includes __type_params__ by default (which is undocumented, see related issue) and type.__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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error