[issue41559] Add support for PEP 612 to typing.py

Ken Jin report at bugs.python.org
Thu Dec 10 19:24:12 EST 2020


Ken Jin <kenjin4096 at gmail.com> added the comment:

The pyre version in their __init__.py looks like they took your advice for
letting the static checker do the work wholeheartedly.

I'm not in favour of type checking either. Just that the pre-existing code
does it for me.

Not type checking when seeing ~P in __parameters__ would work, just that
__args__ will be unhashable (like you mentioned) so things will be slower
due to no type cache. Maybe we can cast the [int, str] to (int, str), that
should work with cache for most cases. And unlike the Callable issue -
since we don't need to ensure runtime correctness - we can ignore any weird
effects to __args__ and __parameters__ in ParamSpec, like TypeVars not
collecting etc.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41559>
_______________________________________


More information about the Python-bugs-list mailing list