File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,11 @@ impl PyObjectRef {
132
132
}
133
133
134
134
pub fn hash ( & self , vm : & VirtualMachine ) -> PyResult < PyHash > {
135
- vm. _hash ( self )
135
+ let hash = self
136
+ . class ( )
137
+ . mro_find_map ( |cls| cls. slots . hash . load ( ) )
138
+ . unwrap ( ) ; // hash always exist
139
+ hash ( self , vm)
136
140
}
137
141
138
142
// const hash_not_implemented: fn(&PyObjectRef, &VirtualMachine) ->PyResult<PyHash> = crate::types::Unhashable::slot_hash;
Original file line number Diff line number Diff line change @@ -1885,14 +1885,6 @@ impl VirtualMachine {
1885
1885
self . _cmp ( & a, & b, op) . map ( |res| res. into_pyobject ( self ) )
1886
1886
}
1887
1887
1888
- pub fn _hash ( & self , obj : & PyObjectRef ) -> PyResult < rustpython_common:: hash:: PyHash > {
1889
- let hash = obj
1890
- . class ( )
1891
- . mro_find_map ( |cls| cls. slots . hash . load ( ) )
1892
- . unwrap ( ) ; // hash always exist
1893
- hash ( obj, self )
1894
- }
1895
-
1896
1888
pub fn obj_len_opt ( & self , obj : & PyObjectRef ) -> Option < PyResult < usize > > {
1897
1889
self . get_special_method ( obj. clone ( ) , "__len__" )
1898
1890
. map ( Result :: ok)
You can’t perform that action at this time.
0 commit comments