mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Make HASH/HASHXOF types immutable (#7131)
This commit is contained in:
1 parent
056cca4476
commit
51bdb0617c
2 files changed
+2
-4
No files matched your search
Vendored
-2
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user