Skip to content

Google sync#646

Merged
rchen152 merged 10 commits into
masterfrom
google_sync
Aug 17, 2020
Merged

Google sync#646
rchen152 merged 10 commits into
masterfrom
google_sync

Conversation

@rchen152

Copy link
Copy Markdown
Contributor

No description provided.

martindemello and others added 10 commits August 17, 2020 14:03
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
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
@google-cla google-cla Bot added the cla: yes label Aug 17, 2020
@rchen152 rchen152 merged commit ccaf6f7 into master Aug 17, 2020
@rchen152 rchen152 deleted the google_sync branch August 17, 2020 22:09
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