def is_empty(self): try: lst = list(self._src) length = len(lst) assert length == 0, \ '%r is not empty, it has %s' % (self._src, itemize_length(self._src)) return True except TypeError: raise AssertionError("%r is not iterable" % self._src)