Make Python builtin types hashable by default
Default hash is the underlying C/C++ pointer. This matches up with testing for equivalence (Py_EQ in SwigPyObject_richcompare) which compares the pointers.
This commit is contained in:
parent
253a39fdff
commit
5b7c08c214
5 changed files with 53 additions and 16 deletions
|
|
@ -211,4 +211,5 @@ typedef destructor freefunc;
|
|||
#if PY_VERSION_HEX < 0x03020000
|
||||
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
|
||||
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
|
||||
#define Py_hash_t long
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue