Dict.get doesn't use any sentinel values. I think once I need for my code something like sentinel and I ended up with some kind of dispatch: if no value use get_no_value instead of get. In any case it is all different versions of making something for missing function overloading. I think about people who learn coding with Python, and here in stdlib a trick is sold as a right way to write code - standard way to handle undefined. Then we will soon have it every as a valid value (like NaN).
View all comments
Show parent comment
1
u/baubleglue Jun 08 '21
Dict.get doesn't use any sentinel values. I think once I need for my code something like sentinel and I ended up with some kind of dispatch: if no value use
get_no_valueinstead ofget. In any case it is all different versions of making something for missing function overloading. I think about people who learn coding with Python, and here in stdlib a trick is sold as a right way to write code - standard way to handle undefined. Then we will soon have it every as a valid value (like NaN).