
Perhaps we can compromise and add an optional new syntax for type aliases that allows forward references? You would have to support both styles (old and new) but you could campaign with your users to switch to the new style and you could offer forward references in aliases and better diagnostics as a carrot (and maybe use a linter as a stick :-). An optional new way of doing things is a much easier sell to people who already have millions of lines of annotated code than a required change.
This sounds very reasonable & we’ll definitely start implementing this as an alternative approach to aliasing while supporting both syntaxes. Once it’s in place and working we’ll start pushing for a change to the new format, with the goal of eventually deprecating support for the old format in Pyre to reduce confusion. In terms of the syntax itself, I agree with your rationale that `x: TypeAlias = int` is cleaner than the alternatives, so we’ll probably get started with that unless there are more concerns raised!

Sounds like a plan. Once you have some experience implementing this in Pyre and using it on your code base, let's talk about how to proceed (it'll need changes to typing, typing_extensions, their stubs in typeshed, and of course support in mypy). I'm not sure whether it requires a PEP -- but at the very least a note should be added to PEP 484 about it. On Wed, Jul 31, 2019 at 1:43 PM Shannon Zhu <szhu@fb.com> wrote:
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>

Sounds like a plan. Once you have some experience implementing this in Pyre and using it on your code base, let's talk about how to proceed (it'll need changes to typing, typing_extensions, their stubs in typeshed, and of course support in mypy). I'm not sure whether it requires a PEP -- but at the very least a note should be added to PEP 484 about it. On Wed, Jul 31, 2019 at 1:43 PM Shannon Zhu <szhu@fb.com> wrote:
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>
participants (2)
-
Guido van Rossum
-
Shannon Zhu