(self,
                            event_name: Optional[str] = None,
                            func: Optional[Callable] = None)
反注册
反注册
反注册
def unregister_callback(self,
                            event_name: Optional[str] = None,
                            func: Optional[Callable] = None):
        """ 反注册 """
        if event_name is None:
            self.__callbacks.clear()
        elif func is None:
            self.__callbacks[event_name].clear()
        else:
            self.__callbacks[event_name].remove(func)
def unregister_callback ( self , event_name : Optional [ str ] = None , func : Optional [ Callable ] = None ) : if event_name is None : self . __callbacks . clear ( ) elif func is None : self . __callbacks [ event_name ] . clear ( ) else : self . __callbacks [ event_name ] . remove ( func )