8000 Fix nondeterministic type checking by making join with explicit Protocol and type promotion commute by hauntsaninja · Pull Request #18402 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix nondeterministic type checking by making join with explicit Protocol and type promotion commute #18402

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 8 commits into from
Jun 1, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
efficiency
  • Loading branch information
hauntsaninja committed May 25, 2025
commit 0b18c18416a345d5fd473d0a05c1d8704a110318
2 changes: 1 addition & 1 deletion mypy/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def join_instances_via_supertype(self, t: Instance, s: Instance) -> ProperType:
for base in t.type.bases:
base_types[base.type] = None
for base in s.type.bases:
if is_subtype(t, base):
if base.type.is_protocol and is_subtype(t, base):
base_types[base.type] = None

best: ProperType | None = None
Expand Down
0