Skip to content

Add one more type-checking pass #18717

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

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@

T = TypeVar("T")

DEFAULT_LAST_PASS: Final = 1 # Pass numbers start at 0
DEFAULT_LAST_PASS: Final = 2 # Pass numbers start at 0

# Maximum length of fixed tuple types inferred when narrowing from variadic tuples.
MAX_PRECISE_TUPLE_SIZE: Final = 8
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/check-modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -1388,14 +1388,14 @@ import b
import b
class C:
def f1(self) -> None:
self.x2
reveal_type(self.x2)
def f2(self) -> None:
self.x2 = b.b
[file b.py]
import a
b = 1 + int()
[out]
tmp/a.py:4: error: Cannot determine type of "x2"
tmp/a.py:4: note: Revealed type is "builtins.int"

[case testErrorInPassTwo1]
import b
Expand Down