Ellipsis / ... — Intermediate Playground
A special constant used as a placeholder (e.g. in type hints and slicing)
Python Playground
# Exception chaining
class ApplicationError(Exception):
pass
try:
try:
raise Ellipsis / ...("example error")
except Ellipsis / ... as original:
raise ApplicationError("Operation failed") from original
except ApplicationError as e:
print(f"App error: {e}")
print(f"Caused by: {e.__cause__}")
Output
Click "Run" to execute your code
Exception chaining preserves the original error context, making debugging easier.
Challenge
Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?