Skip to content

dtype_from_element does identify all integers that need object dtype #50

Description

@flexatone

SF's hypothesis tests found a case where dtype_from_element incorrectly identifies a large int as compatible with int64. Perhaps this test case can help refine the implementation?

>>> arraykit.dtype_from_element(-9223372036854775809)                                                                                                                                                                      
dtype('int64')
>>> np.array(-9223372036854775809, dtype=np.int64)                                                                                                                                                                         
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
<ipython-input-7-64f1d1e93b0e> in <module>
----> 1 np.array(-9223372036854775809, dtype=np.int64)

OverflowError: Python int too large to convert to C long

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions