diff --git a/src/PyCall.jl b/src/PyCall.jl index f1987a29..a5d5738f 100644 --- a/src/PyCall.jl +++ b/src/PyCall.jl @@ -271,22 +271,22 @@ end # computing hashes of PyObjects const pysalt = hash("PyCall.PyObject") # "salt" to mix in to PyObject hashes -hashsalt(x) = hash(x, pysalt) -function hash(o::PyObject) +function hash(o::PyObject, salt::UInt) + salt ⊻= pysalt if ispynull(o) - hashsalt(C_NULL) + hash(C_NULL, salt) elseif is_pyjlwrap(o) # call native Julia hash directly on wrapped Julia objects, # since on 64-bit Windows the Python 2.x hash is only 32 bits - hashsalt(unsafe_pyjlwrap_to_objref(o)) + hash(unsafe_pyjlwrap_to_objref(o), salt) else h = ccall((@pysym :PyObject_Hash), Py_hash_t, (PyPtr,), o) if h == -1 # error pyerr_clear() - return hashsalt(PyPtr(o)) + return hash(PyPtr(o), salt) end - hashsalt(h) + hash(h, salt) end end diff --git a/src/precompile.jl b/src/precompile.jl index cdd75906..3cf0aac3 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -372,7 +372,6 @@ precompile(Tuple{typeof(getproperty), PyDict{Int64, String, true}, Symbol}) precompile(Tuple{typeof(getproperty), PyError, Symbol}) precompile(Tuple{typeof(getproperty), PyObject, String}) precompile(Tuple{typeof(hash), PyObject}) -precompile(Tuple{typeof(hashsalt), Function}) precompile(Tuple{typeof(hasproperty), PyObject, String}) precompile(Tuple{typeof(hasproperty), PyObject, Symbol}) precompile(Tuple{typeof(hassym), Ptr{Nothing}, Symbol}) @@ -528,4 +527,4 @@ precompile(Tuple{typeof(unsafe_load), Ptr{Ptr{PyObject_struct}}}) precompile(Tuple{typeof(weakref_callback), Ptr{PyObject_struct}, Ptr{PyObject_struct}}) precompile(Tuple{typeof(xor), Int64, PyObject}) precompile(Tuple{typeof(xor), PyObject, Int64}) -precompile(Tuple{typeof(xor), PyObject, PyObject}) \ No newline at end of file +precompile(Tuple{typeof(xor), PyObject, PyObject})