The state of PEP 613 - Explicit Type Aliases in Python 3.9
Hi there! I'm wondering about the current state of PEP 613 "Explicit Type Aliases". The document in "accepted" state, and it seems to me that it was even scheduled for Python 3.9 at some point. However now, as 3.9.0b1 is out, the name "TypeAlias" is not present in typing module. What's more, it also has been removed from typing.pyi in Typeshed lately. Mypy has no trackable plans of supporting it anytime soon either, at least judging by my question in the Gitter chat. Is "TypeAlias" still going to appear in 3.9 or at least be available via typing_extensions? Thanks!
Am 22.05.20 um 15:26 schrieb Mikhail Golubev via Typing-sig:
I'm wondering about the current state of PEP 613 "Explicit Type Aliases". The document in "accepted" state, and it seems to me that it was even scheduled for Python 3.9 at some point. However now, as 3.9.0b1 is out, the name "TypeAlias" is not present in typing module. What's more, it also has been removed from typing.pyi in Typeshed lately. Mypy has no trackable plans of supporting it anytime soon either, at least judging by my question in the Gitter chat.
Just a point of clarification: typing.TypeAlias in typeshed was not related to PEP 613, just an internal helper class. Therefore it was marked as private and renamed to _Alias. - Sebastian
Thanks, I also assumed that it was a helper with a clashing name. But was its removal a deliberate step towards actually adding TypeAlias "back" to typing in its new role anytime soon?
Since 3.9 beta 1 has now been released without this, I think our best bet is to add this to typing_extensions (which has no embargo like that) and strive to add it to typing.py in 3.10. Pull Requests for both of these (as well as for typeshed) will be most welcome. We also need an implementation in mypy (which may be harder to contribute, since it would require updating some tricky mypy internals). On Fri, May 22, 2020 at 8:38 AM Mikhail Golubev via Typing-sig < typing-sig@python.org> wrote:
Thanks, I also assumed that it was a helper with a clashing name. But was its removal a deliberate step towards actually adding TypeAlias "back" to typing in its new role anytime soon? _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: guido@python.org
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>
Thanks for clarifying the situation. It would be great to see TypeAlias in typing_extensions. To give some context, we've already have preliminary support for PEP 613 in PyCharm, but now when TypeAlias is neither implemented in 3.9 beta 1, nor available via typing_extensions, it wasn't clear whether we should keep working on that to include in the next release or postpone until things clear up/Python 3.10. Things cleared up :)
Shannon: since Pyre supports TypeAlias, presumably you have made some local changes to typing.py or typing_extensions. Do you have some code to share so we can get this into typing_extensions and the 3.10 copy of typing.py? (Also typeshed.) On Mon, May 25, 2020 at 10:47 AM Mikhail Golubev via Typing-sig < typing-sig@python.org> wrote:
Thanks for clarifying the situation. It would be great to see TypeAlias in typing_extensions.
To give some context, we've already have preliminary support for PEP 613 in PyCharm, but now when TypeAlias is neither implemented in 3.9 beta 1, nor available via typing_extensions, it wasn't clear whether we should keep working on that to include in the next release or postpone until things clear up/Python 3.10. Things cleared up :) _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: guido@python.org
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>
If Shannon doesn't have it ready to merge, I can try to contribute both to typing/typing_extensions and Typeshed. On Mon, May 25, 2020 at 10:08 PM Guido van Rossum <guido@python.org> wrote:
Shannon: since Pyre supports TypeAlias, presumably you have made some local changes to typing.py or typing_extensions. Do you have some code to share so we can get this into typing_extensions and the 3.10 copy of typing.py? (Also typeshed.)
On Mon, May 25, 2020 at 10:47 AM Mikhail Golubev via Typing-sig < typing-sig@python.org> wrote:
Thanks for clarifying the situation. It would be great to see TypeAlias in typing_extensions.
To give some context, we've already have preliminary support for PEP 613 in PyCharm, but now when TypeAlias is neither implemented in 3.9 beta 1, nor available via typing_extensions, it wasn't clear whether we should keep working on that to include in the next release or postpone until things clear up/Python 3.10. Things cleared up :) _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: guido@python.org
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>
-- Mikhail Golubev Software Developer JetBrains http://www.jetbrains.com The drive to develop
I suggest you go ahead. On Fri, May 29, 2020 at 6:47 AM Mikhail Golubev < mikhail.golubev@jetbrains.com> wrote:
If Shannon doesn't have it ready to merge, I can try to contribute both to typing/typing_extensions and Typeshed.
On Mon, May 25, 2020 at 10:08 PM Guido van Rossum <guido@python.org> wrote:
Shannon: since Pyre supports TypeAlias, presumably you have made some local changes to typing.py or typing_extensions. Do you have some code to share so we can get this into typing_extensions and the 3.10 copy of typing.py? (Also typeshed.)
On Mon, May 25, 2020 at 10:47 AM Mikhail Golubev via Typing-sig < typing-sig@python.org> wrote:
Thanks for clarifying the situation. It would be great to see TypeAlias in typing_extensions.
To give some context, we've already have preliminary support for PEP 613 in PyCharm, but now when TypeAlias is neither implemented in 3.9 beta 1, nor available via typing_extensions, it wasn't clear whether we should keep working on that to include in the next release or postpone until things clear up/Python 3.10. Things cleared up :) _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: guido@python.org
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>
-- Mikhail Golubev Software Developer JetBrains http://www.jetbrains.com The drive to develop
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>
participants (3)
-
Guido van Rossum
-
Mikhail Golubev
-
Sebastian Rittau