This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kj
Recipients gvanrossum, kj
Date 2021-04-17.03:10:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618629035.49.0.0863939016996.issue41559@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2021-04-17 03:10:35kjsetrecipients: + kj, gvanrossum
2021-04-17 03:10:35kjsetmessageid: <1618629035.49.0.0863939016996.issue41559@roundup.psfhosted.org>
2021-04-17 03:10:35kjlinkissue41559 messages
2021-04-17 03:10:34kjcreate