Post #2787039
2026-03-02 21:26 UTC
@myself@mastodon.online @AlSweigart@mastodon.social ... is used in type stubs as a soft signal that there is no implementation because the implementation is irrelevant (only the signature)
In non-stub code, I think it's all aesthetic. I use ... in examples sometimes, but would only use pass in 'real' code if I had a do-nothing impl.
Replies (1)
-
@nlswrnr@mastodon.social 2026-03-02 21:35
@SnoopJ@hachyderm.io @myself@mastodon.online @AlSweigart@mastodon.social it's also used in indexing, e.g. `a[..., 0]` means `a[:, :, :, 0]` but works for any number of axes. And I'd also say its equivalence to `pass` is just syntactic sugar.