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

Use is to compare values with None #4

Merged
merged 1 commit into from
Aug 26, 2023
Merged

Conversation

temp20230620
Copy link
Contributor

isinstance throws an exception when used with None.

Thanks for merging the previous ones!

`isinstance` throws an exception when used with None.
@mschuett
Copy link
Owner

Thank you for creating the PRs :)

I learned now that isinstance(x, NoneType) would work too. But PEP8 recommends "Comparisons to singletons like None should always be done with is or is not", so this change is the right one.

@mschuett mschuett merged commit b710c77 into mschuett:main Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants