preheat_open.query.NoUniqueElementError

exception preheat_open.query.NoUniqueElementError

Exception raised when multiple elements are found where one is expected.

This exception is raised by the unique() function when attempting to retrieve a unique element from a generator that yields multiple elements.

Example:
>>> def multi_generator():
...     yield 1
...     yield 2
>>>
>>> try:
...     unique(multi_generator())
... except NoUniqueElementError as e:
...     str(e)
'Generator yields more than one unique element'