Search⌘ K

Ellipsis

Explore how the Ellipsis object functions in Python as a placeholder, a versatile tool for slicing multi-dimensional arrays, and in type hinting. This lesson helps you understand practical applications of Ellipsis to write clearer and more efficient Python code.

We'll cover the following...

Ellipses are pointless…because they have curves.

Python 3.5
def some_func():
Ellipsis
print("Calling some_func")
some_func()
print(Ellipsis)
SomeRandomString # Shoulld throw error

Explanation

In Python, Ellipsis is a globally available built-in object which is equivalent to ....

Python 3.5
print(...)
  • Ellipsis can be used for several purposes, such as:
...
...