예제 #1
0
파일: hashing.py 프로젝트: esc/numba
 def impl(val):
     kindwidth = _kind_to_byte_width(val._kind)
     _len = len(val)
     # use the cache if possible
     current_hash = val._hash
     if current_hash != -1:
         return current_hash
     else:
         # cannot write hash value to cache in the unicode struct due to
         # pass by value on the struct making the struct member immutable
         return _Py_HashBytes(val._data, kindwidth * _len)
예제 #2
0
 def impl(val):
     kindwidth = _kind_to_byte_width(val._kind)
     _len = len(val)
     # use the cache if possible
     current_hash = val._hash
     if current_hash != -1:
         return current_hash
     else:
         # cannot write hash value to cache in the unicode struct due to
         # pass by value on the struct making the struct member immutable
         return _Py_HashBytes(val._data, kindwidth * _len)