![](https://secure.gravatar.com/avatar/b01753e0c78849bd34045ed730d59db6.jpg?s=120&d=mm&r=g)
On Sun, Sep 27, 2020 at 2:18 PM MRAB <python@mrabarnett.plus.com> wrote:
Consider, for example, the use-case of a function that has an optional parameter and you want a way to know whether an argument has been provided but None is a valid value that could be passed in.
Having a singleton such as Missing would be helpful there.
The trouble is that's what None was supposed to be for. Over time, Missing would presumably fall victim to the same fate that befell None. You'd also probably have to extend PEP 505 to support Missing-aware operators. Maybe a singleton that supported no useful operations, not even __eq__ or __bool__, would be sufficiently inconvenient that it would only be used for defaults and "is" tests for said defaults. On Sun, Sep 27, 2020 at 10:52 PM Chris Angelico <rosuav@gmail.com> wrote:
English treats 1 as special and 0 as the same as other numbers when it comes to singulars and plurals. [...] What do other languages do in this way?
You were asking about natural languages but perhaps it's worth mentioning that Haskell has tuples of length 0, 2, 3, ..., but no tuples of length 1. Tuples are meant for putting n values where 1 value is expected, and when n=1 you just put the value there. On Mon, Sep 28, 2020 at 11:47 AM Stefano Borini <stefano.borini@gmail.com> wrote:
Also, it would give different behavior between d[x] and d[x, **kw], which in my opinion should be a fully degenerate case.
On the other hand, it would make d[x,] and d[x, **kw] consistent, which they also ought to be. What a mess.