From 75733787aa1756c7df64d39cea29b22b15a10229 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Fri, 27 Jun 2025 20:54:19 +0900 Subject: [PATCH] Fix boundmethod not to have __dict__ + immutable type --- 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 6f6e1317dc..5fd268fd90 100644 --- a/Lib/test/test_funcattrs.py +++ b/Lib/test/test_funcattrs.py @@ -276,8 +276,6 @@ def test___self__(self): 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 @@ def test_setting_dict_to_invalid(self): 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 4cd2b8604f..ae4784079c 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]