Skip to content
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

Enhanced the type(y) == x type guard logic to support the case wher… #9266

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

erictraut
Copy link
Collaborator

…e y is declared as a type variable with an upper bound that overlaps with the type of x. This addresses #9227.

…e `y` is declared as a type variable with an upper bound that overlaps with the type of `x`. This addresses #9227.
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

yarl (https://github.com/aio-libs/yarl)
-   /tmp/mypy_primer/projects/yarl/yarl/_url.py:251:20 - error: Type "str | SplitResult | URL" is not assignable to return type "Self@URL"
+   /tmp/mypy_primer/projects/yarl/yarl/_url.py:251:20 - error: Type "str | SplitResult | URL*" is not assignable to return type "Self@URL"
-     Type "str | SplitResult | URL" is not assignable to type "Self@URL" (reportReturnType)
+     Type "str | SplitResult | URL*" is not assignable to type "Self@URL" (reportReturnType)

@erictraut erictraut merged commit 235dbcb into main Oct 19, 2024
18 checks passed
@erictraut erictraut deleted the issue-9227 branch October 19, 2024 23:51
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.

1 participant