Replies: 1 comment 4 replies
-
This is a bug in mypy. In this example, it Consider if def foo(proto: MyProtocol) -> None:
proto.my_callable(1, 2, 3, 4) Your program would now crash. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on some TypeShed improvements, and noticed one difference in MyPy/Pyright that's making something I'm working on trickier. Take this example:
Pyright Playground
MyPy Playground
In the case that a protocol accepts arbitrary positional arguments, Pyright required the class implementing the protocol actually type out
*args
, as opposed to being able to lay out specific types for those positional args, or also have them be keyword arguments.Curious if this is intentional, or perhaps could be considered a bug? Personally, I'm a bit surprised this would raise a warning.
Beta Was this translation helpful? Give feedback.
All reactions