- Notifications
You must be signed in to change notification settings - Fork752
Closed
Description
PyObject.GetHashCode()
can throw an OverflowException becauseIntPtr.ToInt32()
does throw. See
pythonnet/src/runtime/pyobject.cs
Line 912 inb8cb6c4
returnRuntime.PyObject_Hash(obj).ToInt32(); |
var ulongVal = (ulong)ptr;return (int)((uint)ulongVal ^ (uint)(ulongVal >> 32));
This happened to me when inserting into a dictionary using tensorflow objects as keys:
new Dictionary<dynamic, dynamic>() { { x, 1.0 }, { y, 1.0 }, }
Environment
- Pythonnet version: 2.3
- Python version: 3.5
- Operating System: Windows 7
Metadata
Metadata
Assignees
Labels
No labels