def __len__(self):
        """Return length.

        Works by counting how many iterations it takes
        to finish iteration.
        """
        ### return number of iterations
        return sum(1 for _ in self.callable_obj())
Return length.

        Works by counting how many iterations it takes
        to finish iteration.
        
nodezator/classes2d/collections.py