5 ms·
Let's try this in python… >>> T = int|None >>> T|None int | None Yep, quite simply this is solved flattening the unions and removing duplicates :)
by bombolo 3y ago
Let's try this in python…
>>> T = int|None
>>> T|None
int | None
Yep, quite simply this is solved flattening the unions and removing duplicates :)
- fhars 3y agoYes, that is the problem, imagine you might write a cache and use None to represent the value not being present in the cache - but then your cache silently fails to cache if the thing you were caching returns None
- bombolo 3y agoAs I already wrote in a different comment, KeyError and None aren't the same.
- dkersten 3y agoThat’s not “solved”, that’s highlighting what the problem is.