Skip to content

Unexpected behaviour of np.finfo with None #14684

@juampamuc

Description

@juampamuc

I am using numpy.iinfo and np.finfo to test whether a given type or value is corresponds to an integer or a float. There is a weird behaviour when dealing with None.

The following fails, as expected:

 import numpy as np
 np.iinfo(None)

Nevertheless

 import numpy as np
 np.finfo(None)

does not, as I would expect. Is that a bug?
IMHO when type(None) returns NoneType, then np.finfo should fail as np.iinfo does.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions