SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 0 Python

gh-144330: Initialize classmethod and staticmethod in new (#144469)

Move classmethod and staticmethod initialization from __init__() to
__new__().

PyClassMethod_New() and PyStaticMethod_New() now copy attributes of
the wrapped functions: __module__, __name__, __qualname__ and
__doc__.

Change static type initialization: initialize PyStaticMethod_Type and
PyCFunction_Type earlier.

Remove test_refleaks_in_classmethod___init__() and
test_refleaks_in_staticmethod___init__() tests from test_descr since
classmethod and staticmethod have no __init__() method anymore.
V
Victor Stinner committed
ffa68529b40210d4c55ad3a4114e48007ae0e55a
Parent: b53fc7c
Committed by GitHub <noreply@github.com> on 2/5/2026, 10:32:56 AM