Last active
March 12, 2026 16:32
-
-
Save mypy-play/a5f86e32e70cbc84c45a53db5426f78f 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
| import typing | |
| class P(typing.Protocol): | |
| def foo(self, a: int) -> None: ... | |
| class C: | |
| def foo(self, *args: int) -> None: pass | |
| def f(o: P) -> None: | |
| o.foo(a=1) | |
| f(C()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment