... is the literal syntax for the Python Elipsis object :
>>> ... Ellipsis
Mostly used by NumPy; see What does the Python Ellipsis object do?
The code you found uses it as a sentinel; a way to detect that no other value was given for the clss keyword argument. Usually you use None for this value, but this will disqualify None itself from being used as the value.
Personally, I do not like to use Ellipsis as a Ellipsis ; Instead, I always created a dedicated watchdog:
_sentinel = object() def elem_name_ensure_class(elem, clss=_sentinel): elem_name, elem_class = elem_split_name_class(elem) if clss is not _sentinel: assert(elem_class == clss) return elem_name.decode('utf-8')
Using the notation ... outside the subscription ( object[...] ) is a syntax error in Python 2, so the trick used restricts Python 3 code.
source share