[issue25714] Consider isinstance(..., numbers.Integral) instead of isinstance(..., int) or isinstance(..., (int, long)) in datetime.py

Matt Bogosian report at bugs.python.org
Tue Dec 1 17:39:16 EST 2015


Matt Bogosian added the comment:

> I consider this as a bug and think that we should weak some of checks isinstance(..., int) to isinstance(..., (int, long)). numbers.Integral is too wide type, C implementation doesn't support it.

Oddly enough, the C implementation is what is working with `future` in this case (although I take your point regarding `numbers.Integral` being too wide; `future.types.newint` effectively behaves like a `long`, and `isinstance(future.types.newint(1), long)` returns `True`).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25714>
_______________________________________


More information about the Python-bugs-list mailing list