mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Make HASH/HASHXOF types immutable (#7131)
This commit is contained in:
2
Lib/test/test_hashlib.py
vendored
2
Lib/test/test_hashlib.py
vendored
@@ -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