Ken Jin <kenjin4...@gmail.com> added the comment:
Guido, I hope I didn't choose a bad time to send this PR over (I suspect you may already be flooded by emails about PEP 563). The jist of the PR is that it's possible to implement PEP 612 in pure-Python. Specifically, PEP 612 says: > As before, parameters_expressions by themselves are not acceptable in places > where a type is expected https://www.python.org/dev/peps/pep-0612/#valid-use-locations Currently, the implementation treats ``ParamSpec`` specially in all builtin ``GenericAlias`` objects just for the sake of ``collections.abc.Callable``. There isn't a need for that - it just needs ``collections.abc.Callable`` to exhibit that behaviour. By implementing this in pure Python, we can: - Conform more strictly to the PEP. - Reduce complexity of the builtin ``GenericAlias`` and also speed it up because less checks are required. - Not tie more typing.py stuff to builtin ``GenericAlias``, which is a plus in my book. What do you think? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41559> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com