Created
October 29, 2026 22:35
-
-
Save mypy-play/77745ad2a91a922249899a057737f667 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import overload, Optional | |
| class A: | |
| pass | |
| class B: | |
| pass | |
| class C: | |
| pass | |
| @overload | |
| def foo(a_or_c: A, b: B, /, x: Optional[str] = None): ... | |
| @overload | |
| def foo(a_or_c: C, /, x: Optional[str] = None): ... | |
| def foo(a_or_c: A | C, b: Optional[B] = None, /, x: Optional[str] = None): | |
| pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment