News for hackers. Stuff that matters.
Re:The many faces of undefined in JavaScript by Ferret7446 on Thursday June 27, 2024 @02:36AM (#40807940)
Maybe I haven't worked with dirty enough Python, but no, I don't think defining a private object in place of `None` is a common idiom at all.

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)`

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.