Feature
RustPython implements deferred annotations, but compiler-generated __annotate__ functions do not consistently receive the CPython-compatible __qualname__.
Minimal reproduction:
def f() -> None:
pass
class Outer:
x: int
def method(self, x: int):
pass
print(f.__annotate__.__name__, f.__annotate__.__qualname__)
print(Outer.__annotate__.__name__, Outer.__annotate__.__qualname__)
print(Outer.method.__annotate__.__name__, Outer.method.__annotate__.__qualname__)
CPython 3.14.6:
__annotate__ f.__annotate__
__annotate__ Outer.__annotate__
__annotate__ Outer.method.__annotate__
RustPython:
__annotate__ __annotate__
__annotate__ Outer.__annotate__
__annotate__ Outer.__annotate__
This is already represented by the expectedFailure marker on RegressionTests.test_annotate_qualname in Lib/test/test_type_annotations.py.
Python Documentation or reference to CPython source code
Feature
RustPython implements deferred annotations, but compiler-generated
__annotate__functions do not consistently receive the CPython-compatible__qualname__.Minimal reproduction:
CPython 3.14.6:
RustPython:
This is already represented by the
expectedFailuremarker onRegressionTests.test_annotate_qualnameinLib/test/test_type_annotations.py.Python Documentation or reference to CPython source code