mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Make singleton builtin types immutable (#7423)
This commit is contained in:
1 parent
692c777e48
commit
3106c30d58
3 files changed
+2
-3
No files matched your search
Vendored
-1
@@ -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):
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user