On Fri, Aug 30, 2019 at 8:28 AM Guido van Rossum <gu...@python.org> wrote: > Open question: at runtime, what should `int | str` return? I don't want this > to have to import the typing module. Maybe we could make a very simple > `Union` builtin. This can then also be used by `~int` (which is equivalent to > `int | None`). >
Would it be okay to have a very simple Union builtin now, and it just always returns exactly that, and then in the future it might potentially actually return Union[int, str] ? I'm not pushing for it *now*, but it would be extremely handy in the future to be able to say isinstance(3, int|str) and have it be meaningful. ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@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/QY277HZIFHPH6OHSN4VZ32ON3243I6DG/ Code of Conduct: http://python.org/psf/codeofconduct/