Skip to content

Conversation

@AryazE
Copy link
Contributor

@AryazE AryazE commented Sep 5, 2024

Since in numpy dtype('float64') == None is True, it is better to check with .type and is instead of ==.

Changes proposed in this pull request:

  • Using the canonical type comparison is instead of ==.

Copy link
Member

@radarhere radarhere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While

>>> import numpy
>>> numpy.dtype('float64') == None
True

is the case, yes, I will note that

>>> numpy.dtype('float64').type == None
False

so it seems like .type is sufficient - but I'm not opposed to is

@hugovk hugovk merged commit a2be72d into python-pillow:main Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants