def __iter__ ( self ) : return iter ( [ v for k , v in sorted ( self . _modes . items ( ) ) ] )
how to get all modes python
Returns the list of modes .
def __iter__(self):
        """
        Returns the list of modes.

        :return:
        """
        return iter([v for k, v in sorted(self._modes.items())])