Add type hint for return type of IRCBot.trigger

This commit is contained in:
jesopo 2018-11-27 17:29:38 +00:00
parent dfbc727dc7
commit e1cdd4a353

View file

@ -33,7 +33,8 @@ class Bot(object):
self._events.on("timer.reconnect").hook(self._timed_reconnect)
def trigger(self,
func: typing.Optional[typing.Callable[[], typing.Any]]=None):
func: typing.Optional[typing.Callable[[], typing.Any]]=None
) -> typing.Any:
func = func or (lambda: None)
if threading.current_thread() is threading.main_thread():
returned = func()