3 ms·
I disagree with your last line, especially for Optional (Union in python is basically useless IMO).
by whimsicalism 5y ago
I disagree with your last line, especially for Optional (Union in python is basically useless IMO).
- folkrav 5y agoIsn't `Optional[T]` just sugar for `Union[T, None]`?
- whimsicalism 5y agoTouché. I guess a common pattern I find myself doing for Union types is having if statements checking if something is of a type using reflection. When checking if it is none, it is more elegant.