8000 Extend special case for context-based typevar inference to typevar unions in return position by sterliakov · Pull Request #18976 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Extend special case for context-based typevar inference to typevar unions in return position #18976

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
Prev Previous commit
Next Next commit
Remove xfail test - fixed in previous PR
  • Loading branch information
sterliakov committed May 6, 2025
commit f1e4dfc60f60ecd64d073dcc519939d5fea023e7
12 changes: 0 additions & 12 deletions test-data/unit/check-inference-context.test
Original file line number Diff line number Diff line change
Expand Up @@ -1510,15 +1510,3 @@ def mymin(
def check(paths: Iterable[str], key: Callable[[str], int]) -> Union[str, None]:
return mymin(paths, key=key, default=None)
[builtins fixtures/tuple.pyi]

[case testInferenceContextMappingGet-xfail]
from collections.abc import Mapping
from typing import TypeVar, Union

_T1 = TypeVar("_T1")

def check(mapping: Mapping[str, _T1]) -> None:
fail1 = mapping.get("", "")
fail2: Union[_T1, str] = mapping.get("", "")
[builtins fixtures/tuple.pyi]
[typing fixtures/typing-full.pyi]
0