5 Sep
2019
5 Sep
'19
2:36 p.m.
On Tue, Sep 03, 2019 at 12:19:15PM -0700, Andrew Barnert via Python-ideas wrote:
On Sep 2, 2019, at 23:50, Philippe Prados <python@prados.fr> wrote:
Add a new operator for `Union[type1|type2]` ?
Hold on. Are you proposing `Union[t1 | t2]` as a new spelling for `Union[t1, t2]`? That seems pointless. I thought you were proposing just `t1 | t2`, which seems a whole lot more useful (and no more disruptive)?
I’m going to assume this is just a typo?
I too assume it was a typo, but for the record, since Union already flattens nested Unions, Union[str|int] would be equivalent to Union[Union[str|int]] which flattens to just str|int. -- Steven