Skip to content

Commit 7573378

Browse files
committed
Fix boundmethod not to have __dict__ + immutable type
1 parent f5ccd4f commit 7573378

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Lib/test/test_funcattrs.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ def test___self__(self):
276276
self.assertEqual(self.fi.a.__self__, self.fi)
277277
self.cannot_set_attr(self.fi.a, "__self__", self.fi, AttributeError)
278278

279-
# TODO: RUSTPYTHON
280-
@unittest.expectedFailure
281279
def test___func___non_method(self):
282280
# Behavior should be the same when a method is added via an attr
283281
# assignment
@@ -331,8 +329,6 @@ def test_setting_dict_to_invalid(self):
331329
d = UserDict({'known_attr': 7})
332330
self.cannot_set_attr(self.fi.a.__func__, '__dict__', d, TypeError)
333331

334-
# TODO: RUSTPYTHON
335-
@unittest.expectedFailure
336332
def test_setting_dict_to_valid(self):
337333
d = {'known_attr': 7}
338334
self.b.__dict__ = d

vm/src/builtins/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ impl PyBoundMethod {
734734

735735
#[pyclass(
736736
with(Callable, Comparable, GetAttr, Constructor, Representable),
737-
flags(HAS_DICT)
737+
flags(IMMUTABLETYPE)
738738
)]
739739
impl PyBoundMethod {
740740
#[pymethod]

0 commit comments

Comments
 (0)