Make HASH/HASHXOF types immutable (#7131)

This commit is contained in:
Lee Dogeon authored and GitHub committed 2026-02-14 20:37:47 +09:00
1 parent 056cca4476
commit 51bdb0617c
2 files changed
+2 -4

No files matched your search

-2
View File
@@ -992,8 +992,6 @@ class HashLibTestCase(unittest.TestCase):
support.check_disallow_instantiation(self, HASH)
support.check_disallow_instantiation(self, HASHXOF)
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_readonly_types(self):
for algorithm, constructors in self.constructors_to_test.items():
# all other types have DISALLOW_INSTANTIATION
+2 -2
View File
@@ -110,7 +110,7 @@ pub mod _hashlib {
}
}
#[pyclass(with(Representable))]
#[pyclass(with(Representable), flags(IMMUTABLETYPE))]
impl PyHasher {
fn new(name: &str, d: HashWrapper) -> Self {
Self {
@@ -183,7 +183,7 @@ pub mod _hashlib {
}
}
#[pyclass]
#[pyclass(flags(IMMUTABLETYPE))]
impl PyHasherXof {
fn new(name: &str, d: HashXofWrapper) -> Self {
Self {