Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

functools.update_wrapper does not work withtype #119011

Closed
Assignees
JelleZijlstra
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or error
@nikola-benes

Description

@nikola-benes

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

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp