Ken Jin <kenjin4...@gmail.com> added the comment:

I'm a little conflicted on this specific use case (but maybe I'm biased because 
I wrote the checks :).

I'm a strong proponent of less runtime checks. However, in this case, the 
exceptions serve as easy hints to the user, and they're meant to catch the most 
basic of errors. At the same time they barely add any overhead to our code.

Also, the last check may be required so that we can easily support subscripts 
(due to runtime quirks). I vaguely remember Serhiy mentioning that the 
semantics for subscripting a Callable[Concatenate[...], ...] is undefined by 
PEP 612. We were planning to formalize/reject the behavior, but I dropped the 
ball on that due to a lack of time. If that materializes, we're gonna raise an 
unclear runtime error about not enough typevars at subscript time anyways, so 
we might as well clearly tell the user at the start to prevent confusion.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46396>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to