Merged
Conversation
Member
|
Looks good. I wonder why mypy itself didn't catch that—are we running with strict-optional off perhaps? |
|
Hi, will this PR be merged? It looks quite simple and finished, or is there some work to be done still? I am interested since I have this issue when running For anyone interested, you can install the fixed version via: I would not recommend installing some strangers repo on any machine. You can install that version once, generate stubs, and then remove it again :) |
JukkaL
approved these changes
Jul 31, 2020
Collaborator
JukkaL
left a comment
There was a problem hiding this comment.
Looks good, thanks for the PR!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In investigating a crash when running on a PyBind11 module, I noticed a mismatch in the types;
infer_prop_type_from_docstringcan clearly get None, but it has a type of plainstr. Fix the annotation to match the expectation. Now, when rebuilding Mypy, the error goes away and this now works without crashing, and can completely generate stubs.Here's one of the uses where None is obviously possible:
mypy/mypy/stubgenc.py
Lines 220 to 221 in d104886
Fixes #7692.
Example printout when this error is seen: