Ellipsis
Up: __builtins__ | Next: False
Rel: True, False, None, NotImplemented, copyright
Ref: docs.python.org — Ellipsis
Tags: #public #python3 #builtins
Import & Availability
# Built-in (available globally without import)
from builtins import Ellipsis
Overview & Signature
Ellipsis -> ellipsis
The type of the Ellipsis singleton.
Usage
# Literal `...` is the Ellipsis singleton—used in type stubs, NumPy slicing, and placeholders
def todo() -> None:
...
assert (...) is Ellipsis
assert bool(Ellipsis) is True
Gotchas
- Always truthy:
bool(...)isTrue. - Distinct from
passin expressions:...is a valid expression value (e.g.Callable[..., int],tuple[int, ...], or NumPyarr[..., 0]), whereaspassis only a statement.
REPL Inspect
help(Ellipsis)
Linked from
- tuts/python3/__builtins__
- tuts/python3/__builtins__/__builtins__
- tuts/python3/__builtins__/copyright
- tuts/python3/__builtins__/credits
- tuts/python3/__builtins__/exit
- tuts/python3/__builtins__/False
- tuts/python3/__builtins__/help
- tuts/python3/__builtins__/license
- tuts/python3/__builtins__/None
- tuts/python3/__builtins__/NotImplemented
- tuts/python3/__builtins__/quit
- tuts/python3/__builtins__/True
Related notes
- tuts/python3/__builtins__/__builtins__ Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/copyright Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/False Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/None Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/NotImplemented Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/True Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__ links to this page; shared tags: #builtins
- tuts/python3/__builtins__/credits links to this page; shared tags: #builtins
- tuts/python3/__builtins__/exit links to this page; shared tags: #builtins
- tuts/python3/__builtins__/help links to this page; shared tags: #builtins