Skip to content

Behaviour of E721 with numpy.dtype #9570

@nstarman

Description

@nstarman

numpy.dtype is tripping rule E721. I'm not sure it should be.

x = np.array([1,2,3], dtype=float)
x.dtype == float  # <- trips E721

.dtype is an object, e.g. a dtype('float64').
While x.dtype == float may not be the best means of testing a dtype, I don't think this is E721.

Metadata

Metadata

Assignees

Labels

acceptedReady for implementationruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions