Google sync#646
Merged
Merged
Conversation
PiperOrigin-RevId: 325876145
pytype gets the expected types for error messages from a function's first overload. `Iterable[nothing]` produces a confusing message; `Iterable[str]` is much better. PiperOrigin-RevId: 325888614
I already cleaned up most of the new findings generated by this change. PiperOrigin-RevId: 326078090
- Drops @type_check_only to preserve existing behaviour. - Silently ignores all other decorators. PiperOrigin-RevId: 326357555
I can't find any documentation on what these flags should be, but CALL_FUNCTION and CALL_METHOD are similar enough that it seems reasonable they'd have the same flags. This fixes the following 3.7 bug: we have a class whose initializer sets an attribute to None, but before the attribute is used, another method is called to set it to its true non-None value. If pytype hits maximum call depth and skips this method, it thinks that the attribute's value is still None. The vm's _has_strict_none_origins check filters out the None value, avoiding spurious errors. In 3.7, _has_strict_none_origins fails to filter out the None because methods are called via CALL_METHOD rather than CALL_FUNCTION, and CALL_METHOD's different flags cause its carry_on_to_next() method to evaluate to False, leading to pytype failing to add an extra node to the CFG after the method is called, which messes up _has_strict_none_origins' reachability query. PiperOrigin-RevId: 326713243
PiperOrigin-RevId: 326775582
The linked issue is only for aliases, but while I was at it, I also added support for `# type: ignore` after a __slots__ definition. Fixes #644. PiperOrigin-RevId: 327078292
Doing a release for the pyi parser fix. PiperOrigin-RevId: 327084848
PiperOrigin-RevId: 327088390
Otherwise, we have `import unittest` twice in parser.py (the second one coming from the copybara rewrite of googletest), leading to a lint error. PiperOrigin-RevId: 327093560
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.
No description provided.