From 3b87cbe559a68e5120c1e2e0a39c1184b3a1c869 Mon Sep 17 00:00:00 2001 From: youknowdot Date: Wed, 21 Oct 2026 18:15:53 -0700 Subject: [PATCH] Mark wrapper descriptors as method descriptors (#9286) * Mark wrapper descriptors as method descriptors Match CPython 3.15 wrapper_descriptor flags so existing method lookup can use the descriptor's direct receiver-prepending dispatch path. Assisted-by: OpenAI Codex:model-version-unavailable * Retire fixed wrapper monitoring expected failure Regenerate test_monitoring from pinned CPython 3.15.0 with the updater, preserving every other adaptation. The METHOD_DESCRIPTOR flag now supplies the canonical receiver in int.__repr__ CALL/C_RETURN events. Assisted-by: OpenAI Codex:model-version-unavailable --- Lib/test/test_monitoring.py | 1 - crates/vm/src/builtins/descriptor.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/test/test_monitoring.py b/Lib/test/test_monitoring.py index ad9b61a65..97998e2d7 100644 --- a/Lib/test/test_monitoring.py +++ b/Lib/test/test_monitoring.py @@ -2333,7 +2333,6 @@ class TestLoadSuperAttr(CheckEvents): self.check_events(nonopt_func, recorders=self.RECORDERS, expected=nonopt_expected) self.check_events(opt_func, recorders=self.RECORDERS, expected=opt_expected) - @unittest.expectedFailure # TODO: RUSTPYTHON; line number differences in multi-line super() calls def test_vs_other_type_call(self): code_template = textwrap.dedent(""" class C: diff --git a/crates/vm/src/builtins/descriptor.rs b/crates/vm/src/builtins/descriptor.rs index 4c7c1804d..7e4048219 100644 --- a/crates/vm/src/builtins/descriptor.rs +++ b/crates/vm/src/builtins/descriptor.rs @@ -2057,7 +2057,7 @@ impl Callable for PyWrapper { #[pyclass( with(GetDescriptor, Callable, Representable), - flags(DISALLOW_INSTANTIATION) + flags(DISALLOW_INSTANTIATION, METHOD_DESCRIPTOR) )] impl Py { #[pymethod]