Antoine Pitrou added the comment:

> It looks like json doesn't check for __index__, and I wonder if it should.

I don't know. Simply, under 2.7, int64 inherits from int:

>>> np.int64.__mro__
(<type 'numpy.int64'>, <type 'numpy.signedinteger'>, <type 'numpy.integer'>, 
<type 'numpy.number'>, <type 'numpy.generic'>, <type 'int'>, <type 'object'>)

while it doesn't under 3.x:

>>> np.int64.__mro__ 
(<class 'numpy.int64'>, <class 'numpy.signedinteger'>, <class 'numpy.integer'>, 
<class 'numpy.number'>, <class 'numpy.generic'>, <class 'object'>)

----------
nosy: +pitrou
type: crash -> enhancement
versions: +Python 3.6 -Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24313>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to