Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonical type comparison #8349

Merged
merged 2 commits into from
Sep 5, 2024
Merged

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
46 of 47 checks passed
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