(self, trigger, source="*", dest="*")
Removes a transition from the Machine and all models.
        Args:
            trigger (str): Trigger name of the transition.
            source (str): Limits removal to transitions from a certain state.
            dest (str): Limits removal to transitions to a certain state.
Removes a transition from the Machine and all models.
        Args:
            trigger (str): Trigger name of the transition.
            source (str): Limits removal to transitions from a certain state.
            dest (str): Limits removal to transitions to a certain state.
Removes a transition from the Machine and all models . Args : trigger ( str ) : Trigger name of the transition . source ( str ) : Limits removal to transitions from a certain state . dest ( str ) : Limits removal to transitions to a certain state .
def remove_transition(self, trigger, source="*", dest="*"):
        """ Removes a transition from the Machine and all models.
        Args:
            trigger (str): Trigger name of the transition.
            source (str): Limits removal to transitions from a certain state.
            dest (str): Limits removal to transitions to a certain state.
        """
        source = listify(source) if source != "*" else source
        dest = listify(dest) if dest != "*" else dest
        # outer comprehension, keeps events if inner comprehension returns lists with length > 0
        tmp = {key: value for key, value in
               {k: [t for t in v
                    # keep entries if source should not be filtered; same for dest.
                    if (source != "*" and t.source not in source) or (dest != "*" and t.dest not in dest)]
                   # }.items() takes the result of the inner comprehension and uses it
                   # for the outer comprehension (see first line of comment)
                for k, v in self.events[trigger].transitions.items()}.items()
               if len(value) > 0}
        # convert dict back to defaultdict in case tmp is not empty
        if tmp:
            self.events[trigger].transitions = defaultdict(list, **tmp)
        # if no transition is left remove the trigger from the machine and all models
        else:
            for model in self.models:
                delattr(model, trigger)
            del self.events[trigger]
def remove_transition ( self , trigger , source = "*" , dest = "*" ) : source = listify ( source ) if source != "*" else source dest = listify ( dest ) if dest != "*" else dest # outer comprehension, keeps events if inner comprehension returns lists with length > 0 tmp = { key : value for key , value in { k : [ t for t in v # keep entries if source should not be filtered; same for dest. if ( source != "*" and t . source not in source ) or ( dest != "*" and t . dest not in dest ) ] # }.items() takes the result of the inner comprehension and uses it # for the outer comprehension (see first line of comment) for k , v in self . events [ trigger ] . transitions . items ( ) } . items ( ) if len ( value ) > 0 } # convert dict back to defaultdict in case tmp is not empty if tmp : self . events [ trigger ] . transitions = defaultdict ( list , * * tmp ) # if no transition is left remove the trigger from the machine and all models else : for model in self . models : delattr ( model , trigger ) del self . events [ trigger ]