You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to request that the TC consider adoption of a new chapter in the typing spec that fills in some missing information about callables, including rules for subtyping.
Links to PR & Discussion
The PR can be found here. The latest draft incorporates feedback from PR reviews and the discussion.
Current Type Checker Behaviors
Most of the update is simply documenting behaviors that type checkers exhibit today.
There is one aspect of the update that will require changes to all type checkers. It is related to the treatment of (*args: Any, **kwargs: Any) as the same as ... in a Callable annotation. The behavior in the draft specification is close to what mypy currently implements, but there are some differences that will require small changes in mypy. The other three major type checkers do not currently treat (*args: Any, **kwargs: Any) specially, so they will require updates to conform to the proposed spec.
Controversial Issues
The only controversial issue relates to the special treatment of (*args: Any, **kwargs: Any). Some people (myself included) would prefer not to treat this specially, but taking into consideration mypy's historical behavior and the pain involved in changing it, a compromise makes sense here. It is not dissimilar to the decision we made for tuple[Any, ...].
The text was updated successfully, but these errors were encountered:
I'd like to request that the TC consider adoption of a new chapter in the typing spec that fills in some missing information about callables, including rules for subtyping.
Links to PR & Discussion
The PR can be found here. The latest draft incorporates feedback from PR reviews and the discussion.
The discussion can be found here.
TC Sign-off
Current Type Checker Behaviors
Most of the update is simply documenting behaviors that type checkers exhibit today.
There is one aspect of the update that will require changes to all type checkers. It is related to the treatment of
(*args: Any, **kwargs: Any)
as the same as...
in aCallable
annotation. The behavior in the draft specification is close to what mypy currently implements, but there are some differences that will require small changes in mypy. The other three major type checkers do not currently treat(*args: Any, **kwargs: Any)
specially, so they will require updates to conform to the proposed spec.Controversial Issues
The only controversial issue relates to the special treatment of
(*args: Any, **kwargs: Any)
. Some people (myself included) would prefer not to treat this specially, but taking into consideration mypy's historical behavior and the pain involved in changing it, a compromise makes sense here. It is not dissimilar to the decision we made fortuple[Any, ...]
.The text was updated successfully, but these errors were encountered: