Skip to content

Latest commit

 

History

History
105 lines (68 loc) · 3.06 KB

README.md

File metadata and controls

105 lines (68 loc) · 3.06 KB

Native class-method descriptor type (#4690)

Original issue. Resolved in the reported scope. The raw dict.__dict__["fromkeys"] descriptor has type classmethod_descriptor; the bound dict.fromkeys has type builtin_function_or_method. Binding and representative additional native descriptors agree with CPython.

Independently rechecked on October 6, 2026 (KST): fresh inputs, results and scope.

Environment

  • Source and standard library: f39b054b9c8c.
  • Verified October 5, 2026 on macOS 26.5.2 ARM64.
  • RustPython: 0.6.1, Python 3.14.0.alpha; native ARM64.
  • Comparison: CPython 3.14.6 ARM64.

Use absolute paths for the variables below:

  • RP: the RustPython executable for this commit.
  • CP: the CPython 3.14.6 executable.
  • SRC: the source directory at this commit, including its matching Lib.
  • CASE: the directory containing the files shown below.

Shell variables replace recorded absolute paths. Export them so the Python inputs can use them:

export RP CP SRC CASE
unset PYTHONPATH PYTHONHOME PYTHONWARNINGS PYTHONSTARTUP
export PYTHONDONTWRITEBYTECODE=1

Reproducer

Save as 4690-original.py.

print(type(dict.__dict__["fromkeys"]))
print(type(dict.fromkeys))

Run

cd "$SRC"

RustPython:

RUSTPYTHONPATH="$SRC/Lib" "$RP" -B "$CASE/4690-original.py"

CPython:

"$CP" -B "$CASE/4690-original.py"

Results

Expected: The raw dict.fromkeys descriptor must be classmethod_descriptor, while the bound method remains builtin_function_or_method.

RustPython and CPython 3.14.6

Exit code: 0. No timeout.

stdout:

<class 'classmethod_descriptor'>
<class 'builtin_function_or_method'>

stderr:

No output.

Historical failure

Previously recorded at 8ff947e83a65; exit code 0. This run was not repeated alongside the current results. Historical inputs may differ from the expanded checks above.

stdout:

classmethod
method

Related change and scope

PR #8780: native OrderedDict and class-method descriptors.

First fixing commit: not established.

Evidence

Recorded executable SHA-256 values:

AI assistance: OpenAI Codex.