
On Thu, 20 May 2021 at 18:13, Luciano Ramalho <luciano@ramalho.org> wrote:
I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) is not a good sentinel. It's a pickable singleton testable with `is`, readily available, and extremely unlikely to appear in a data stream. Its repr is "Ellipsis".
Personally, I'm quite tempted by the idea of using ellipsis. It just sort of feels reasonable (and in the context `def f(x, optional_arg=...)` it even looks pretty natural). But it nevertheless feels like a bit of an abuse - the original point of ellipsis was for indexing, and in particular complex slices like a[1:20:2, ..., 3:5]. That usage is common in numpy, as I understand it, even if it's relatively rare in everyday Python. So while I like the idea in principle, I'm mildly worried that it's not "the right thing to do". I can't put my ambivalence about the idea any more precisely than this, unfortunately. Paul