8000 Exclude irrelevant members in `narrow_declared_type` from union overlapping with enum by sterliakov · Pull Request #18897 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Exclude irrelevant members in narrow_declared_type from union overlapping with enum #18897

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 6 commits into from
Apr 11, 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
Restore error back
  • Loading branch information
sterliakov committed Apr 7, 2025
commit aa219cff7eea6ffb79d238fb419fb408bdcad5fb
3 changes: 2 additions & 1 deletion test-data/unit/check-typeguard.test
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ def process_model(model: Union[MODEL_A, MODEL_B]) -> int:

def handle(model: Model) -> int:
if is_model_a(model) or is_model_b(model):
return process_model(model)
# TODO: should start passing after #18896
return process_model(model) # E: Argument 1 to "process_model" has incompatible type "Model"; expected "Union[Literal[Model.MODEL_A1, Model.MODEL_A2], Literal[Model.MODEL_B]]"
return 0
[builtins fixtures/tuple.pyi]
0