You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PEP 749: classmethod and staticmethod do not implement annotation wrapper semantics #8494
PEP 749 specifies writable __annotate__ and __annotations__ attributes for classmethod and staticmethod. Reading should retrieve and cache the wrapped callable's value in the wrapper's __dict__; writing should update only the wrapper, not the wrapped callable.
CPython 3.14.6 caches __annotations__ in each wrapper and leaves f.__annotations__ unchanged after assignment.
RustPython does not cache the delegated value in the wrapper for the unresolved-name case, and assignment mutates the wrapped function's annotations. This is already represented by the expectedFailure marker on ClassPropertiesAndMethods.test_classmethod_staticmethod_annotations in Lib/test/test_descr.py.
Python Documentation or reference to CPython source code
Activity
hyoinandout commentedon Aug 12, 2026
take
hyoinandout commentedon Sep 20, 2026
fixed by #8701 @youknowone could you have a check?
youknowone commentedon Sep 20, 2026
@hyoinandout thank you for confirming!
Record independent closure recheck and correct draft wording
youknowone commentedon Oct 6, 2026
The originally reported problem no longer reproduces on current main. Closing per the recheck in #8982.
— commented by Grok 4.6