-
Notifications
You must be signed in to change notification settings - Fork 258
Tuple and Callable should be listed as generic variants of builtin classes #212
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
Comments
I disagree. Both typing.py and mypy special-case the heck out of these, and
they support syntax that doesn't apply to regular generics.
|
You see this more from the position of implementation, I see this more from the position of interface. Probably you are right, This qestion appeared in the context of compromise that I discussed in #136 , namely we always raise
If you agree, I could make a PR to change the formulation in PEP |
I can't follow what you're arguing for any more, so just send a PR and
I'll look at that.
FWIW Tuple is also special because it's variadic, and because it supports
the form with ellipsis.
|
@gvanrossum I have submitted a PR #214 . Finally, I decided, that it is better to just be more precise about subclasses vs subtypes, remove the mention of In this way I am OK with keeping the current structure of sections in PEP describing |
Fixed by #214 |
Currently
Callable
andTuple
are listed in the section "Fundamental building blocks", I would rather move them to "Generic variants of builtin classes". Indeed,Callable[..., [Any]]
could be just equivalent tocollections.abc.Callable
(See also this comment #133 (comment)), andTuple[Any, ...]
could be just equivalent totuple
, in the same way asList[Any]
is an equivalent oflist
.Also, although
Optional
is just a particular case ofUnion
, maybe it should be listed in the section "Fundamental building blocks" for completeness.The text was updated successfully, but these errors were encountered: