Message 109352 - Python tracker (original) (raw)

This is a bit strange. timedelta is accepting int subclass instances:

class I(int): ... pass ... timedelta(days = I(36)) datetime.timedelta(36)

but not numpy.unt_:

timedelta(days = int_(36)) Traceback (most recent call last): File "", line 1, in TypeError: unsupported type for timedelta days component: numpy.int64

which is also a subclass of int:

isinstance(int_(36), int) True

This is probably a numpy quirk rather than python issue, but is probably worth another look.