Make singleton builtin types immutable (#7423)

This commit is contained in:
Lee Dogeon authored and GitHub committed 2026-03-14 09:45:43 +09:00
1 parent 692c777e48
commit 3106c30d58
3 files changed
+2 -3

No files matched your search

-1
View File
@@ -2434,7 +2434,6 @@ class BuiltinTest(ComplexesAreIdenticalMixin, unittest.TestCase):
with self.assertRaisesRegex(TypeError, msg):
not NotImplemented
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: TypeError not raised
def test_singleton_attribute_access(self):
for singleton in (NotImplemented, Ellipsis):
with self.subTest(singleton):
+1 -1
View File
@@ -98,7 +98,7 @@ impl Constructor for PyNotImplemented {
}
}
#[pyclass(with(Constructor, AsNumber, Representable))]
#[pyclass(with(Constructor, AsNumber, Representable), flags(IMMUTABLETYPE))]
impl PyNotImplemented {
#[pymethod]
fn __reduce__(&self, vm: &VirtualMachine) -> PyStrRef {
+1 -1
View File
@@ -393,7 +393,7 @@ impl Constructor for PyEllipsis {
}
}
#[pyclass(with(Constructor, Representable))]
#[pyclass(with(Constructor, Representable), flags(IMMUTABLETYPE))]
impl PyEllipsis {
#[pymethod]
fn __reduce__(&self, vm: &VirtualMachine) -> PyStrRef {