Skip to content

Comments

Remove prohibit_none_typevar_overlap#20864

Merged
hauntsaninja merged 2 commits intopython:masterfrom
hauntsaninja:noprohibit
Feb 23, 2026
Merged

Remove prohibit_none_typevar_overlap#20864
hauntsaninja merged 2 commits intopython:masterfrom
hauntsaninja:noprohibit

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Feb 22, 2026

Noticed this seems to be useless while investigating a fix for narrowing with TypeVars

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninja hauntsaninja marked this pull request as ready for review February 23, 2026 00:05
hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request Feb 23, 2026
@@ -9322,13 +9322,7 @@ def is_overlapping_types_for_overload(left: Type, right: Type) -> bool:
# def foo(x: None) -> None: ..
# @overload
# def foo(x: T) -> Foo[T]: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this example in the comment still work (is there an existing test case for this)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, see testOverloadDetectsPossibleMatchesWithGenerics and #15846

@hauntsaninja hauntsaninja merged commit 39156e0 into python:master Feb 23, 2026
24 checks passed
@hauntsaninja hauntsaninja deleted the noprohibit branch February 23, 2026 21:20
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