-
Notifications
You must be signed in to change notification settings - Fork 3
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
Incorrect check for NoneType
#95
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
96f33d7
nested call to `type` is not necessary
jdidion bf672de
correctly check NoneType, test python 3.11 and 3.12
jdidion cff99b7
revert reformatting
jdidion 8c98fb6
Poetry 1.7 is required for python 3.12, but Poetry dropped support fo…
jdidion 797f670
update poetry lockfile
jdidion ea71daf
reformat
jdidion 3754377
reformat
jdidion 6751774
update black version
jdidion 4205de6
ignore erroneous mypy error
jdidion 36bc2f1
reformat
jdidion 17c5b6d
ignore erroneous mypy error
jdidion 89c855a
reformat
jdidion dd0a325
try 3.12 again
jdidion 2f5e6c4
update lockfile
jdidion 964dc1d
update min flake8 version
jdidion 75dd664
update lockfile
jdidion 3673fea
flake8 is the problem not mypy
jdidion f0ddfaf
update mypy minimum version for python 3.7
jdidion 356ef34
temporary remove build for 3.7
jdidion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdidion following up on your question from Slack, I think this is the right approach.
as far as I'm aware, flake8 guards against
type(x) == int
and the like. We're doing equality checks against types above (e.g.if type_ == bool
) and flake8 doesn't complain, I'm guessing because we don't calltype()
in the same line.If you wanted to avoid the
noqa
, you could declareNoneType = type(None)
above (or infgpyo.types
and import it), then replace this line withelif type_ is NoneType
. But this feels like an edge case in flake8, so I think what you have is fine if you're fine with it