Skip to content

Fix boundmethod not to have __dict__ #5851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Lib/test/test_funcattrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vm/src/builtins/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ impl PyBoundMethod {

#[pyclass(
with(Callable, Comparable, GetAttr, Constructor, Representable),
flags(HAS_DICT)
flags(IMMUTABLETYPE)
)]
impl PyBoundMethod {
#[pymethod]
Expand Down
Loading