by davidshepherd7 · 4y ago · 0 comments
But, I often solve this with a function like:
``` def default_to(x: Optional[T], d: T) -> T: return x if x is not None else d ```
I wonder if having this function as the official way to do it would solve the problem without the "specialness" of `??`.
But there's no good equivalent that I know of for `?.`, that's a real pain to do with python as it is now so it seems like a nice addition.
No comments yet.