From 43302cec4dabbc264082cb528d29798d1d72cc84 Mon Sep 17 00:00:00 2001 From: "Jeong, YunWon" <69878+youknowone@users.noreply.github.com> Date: Fri, 27 Jun 2025 22:50:58 +0900 Subject: [PATCH] Fix boundmethod not to have __dict__ + immutable type (#5851) --- Lib/test/test_funcattrs.py | 4 ---- vm/src/builtins/function.rs | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py index 6f6e1317d..5fd268fd9 100644 --- a/Lib/test/test_funcattrs.py +++ b/Lib/test/test_funcattrs.py @@ -276,8 +276,6 @@ class InstancemethodAttrTest(FuncAttrsTest): self.assertEqual(self.fi.a.__self__, self.fi) self.cannot_set_attr(self.fi.a, "__self__", self.fi, AttributeError) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test___func___non_method(self): # Behavior should be the same when a method is added via an attr # assignment @@ -331,8 +329,6 @@ class FunctionDictsTest(FuncAttrsTest): d = UserDict({'known_attr': 7}) self.cannot_set_attr(self.fi.a.__func__, '__dict__', d, TypeError) - # TODO: RUSTPYTHON - @unittest.expectedFailure def test_setting_dict_to_valid(self): d = {'known_attr': 7} self.b.__dict__ = d diff --git a/vm/src/builtins/function.rs b/vm/src/builtins/function.rs index 4cd2b8604..ae4784079 100644 --- a/vm/src/builtins/function.rs +++ b/vm/src/builtins/function.rs @@ -734,7 +734,7 @@ impl PyBoundMethod { #[pyclass( with(Callable, Comparable, GetAttr, Constructor, Representable), - flags(HAS_DICT) + flags(IMMUTABLETYPE) )] impl PyBoundMethod { #[pymethod]