With my implementation, I can check
assert int | None == None | int
is true

Le lun. 2 sept. 2019 à 13:32, Ivan Levkivskyi <levkivskyi@gmail.com> a écrit :
On Thu, 29 Aug 2019 at 23:48, Guido van Rossum <guido@python.org> wrote:
On Thu, Aug 29, 2019 at 3:33 PM Chris Angelico <rosuav@gmail.com> wrote:
On Fri, Aug 30, 2019 at 8:28 AM Guido van Rossum <guido@python.org> wrote: 
[...]

I do tink we should probably review PEP 585 before doing anything about unions specifically -- likely there are bigger fish to fry. (And PEP 585 has not received much discussion.)

I also agree with this. Generally I am fine with Union[int, str] and Optional[int], but I also see how some people might want a shorter notation. Many things around typing have been previously
rejected because we didn't want to introduce any (or at least minimal) changes to the syntax and runtime, but now that typing is much more widely used we can reconsider some of these.
Importantly, I think this should be done in a systematic way (potentially using PEP 585 draft as a starting point).

--
Ivan

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/YZHAERD5T4TZL62A6EI4BCKKAQYNJGSU/
Code of Conduct: http://python.org/psf/codeofconduct/