Re:The many faces of undefined in JavaScript
by lifthrasiir on Thursday June 27, 2024 @02:58AM
(#40808065)
I mean, it's common when the argument itself has a domain of all possible Python objects and therefore `None` should be usable as a literal value. The requirement itself is not very common, but virtually all code with that requirement uses this idiom in my knowledge.
None signifies absence, and if you need to pass a special value, then you might define a special object for that.
You can't distinguish `foo(obj=None)` from `foo()` because they are the same thing. You probably want something like `foo(obj=UNSET)`