prefix should be a Optional[IRCHostmask], we shouldn't use Optional[] as a

compile-time object (utils.irc)
This commit is contained in:
jesopo 2018-11-20 17:23:14 +00:00
parent 45c7ce6da5
commit 60acf02cee

View file

@ -64,8 +64,8 @@ class IRCArgs(object):
class IRCLine(object): class IRCLine(object):
def __init__(self, tags: dict, prefix: typing.Optional[str], command: str, def __init__(self, tags: dict, prefix: typing.Optional[IRCHostmask],
args: IRCArgs, has_arbitrary: bool): command: str, args: IRCArgs, has_arbitrary: bool):
self.tags = tags self.tags = tags
self.prefix = prefix self.prefix = prefix
self.command = command self.command = command
@ -81,7 +81,7 @@ def message_tag_unescape(s):
def parse_line(line: str) -> IRCLine: def parse_line(line: str) -> IRCLine:
tags = {} tags = {}
prefix = typing.Optional[IRCHostmask] prefix = None # type: typing.Optional[IRCHostmask]
command = None command = None
if line[0] == "@": if line[0] == "@":