Ellipsis / ...
Built-in ConstantPython 2.0+Intermediate
A special constant used as a placeholder (e.g. in type hints and slicing)
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
Learn by Difficulty
Quick Example
python
# Triggering and catching Ellipsis / ... try: raise Ellipsis / ...("example error") except Ellipsis / ... as e: print(f"Caught Ellipsis / ...: {e}") print(f"Type: {type(e).__name__}")
Ellipsis / ... is raised when a special constant used as a placeholder (e.g. in type hints and slicing). Always catch specific exceptions rather than bare except clauses.
Try in PlaygroundTags
builtinconstantcore