Description
I noticed that there's a special type alias MaybeNone
that represents this specific intent:
We didn't dare to change the type to
X | None
so instead we changed it toAny
You can find an example in a relatively recent addition of this.
And while this approach makes me very sad, it is good that such cases are marked with MaybeNone
, for the purpose of looking at them specially. Maybe some type checker will arise that will have specific handling for it and do something smarter instead.
With that in mind, it would be good to ensure that all such cases are consistently marked.
I noticed at least one case that is not marked like this. It has | Any
directly written instead of | MaybeNone
. This is in re.match.group*
:
Lines 93 to 117 in 6feca18