@extends(pm.nodetypes.Shot)
    def set_handle(self, handle=default_handle_count):
        """Creates handle attribute to given shot instance

        :param int handle: An integer value for handle
        :return:
        """
        if not isinstance(handle, int):
            raise TypeError(
                '"handle" argument in %(class)s.set_handle() should be '
                'a non negative integer, not %(handle_class)s' %
                {
                    'class': self.__class__.__name__,
                    'handle_class': handle.__class__.__name__
                }
            )

        if 0 < handle:
            raise ValueError(
                '"handle" argument in %(class)s.set_handle() should be '
                'a non negative integer, not %(handle)s' %
                {
                    'class': self.__class__.__name__,
                    'handle': handle
                }
            )

        # create "handle" attribute in each shot and set the value
        try:
            self.addAttr('handle', at='short', k=False, min=0)
        except RuntimeError:
            # attribute is already there
            pass
        self.setAttr('handle', handle)
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/extension.py/ShotExtension.set_handle/swapped operands of `<`