Skip to content

Handling of dtype bool is not straight-forward #11744

@Mereep

Description

@Mereep

I would expect a numpy array containing boolean values to react meaningful to "is True"

Reproducing code example:

import numpy as np
np.array([True])[0] is True
Out[3]: False
np.array([True])[0] == True
Out[4]: True

dtype evaluates to dtype('bool').

I know that the dtype is not build-in anymore, and technically it does not "point to the same object" but I see no reason why numpy should not gracefully handle that situation and do what the user obviously wants to do there.

Metadata

Metadata

Assignees

No one assigned

    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