Fix new mypy errors

This commit is contained in:
James Westman 2022-11-22 11:38:00 -06:00
parent bc15ac9efb
commit 86b07ef0ae
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
2 changed files with 2 additions and 2 deletions

View file

@ -141,7 +141,7 @@ class CompilerBugError(Exception):
""" Emitted on assertion errors """
def assert_true(truth: bool, message:str=None):
def assert_true(truth: bool, message: T.Optional[str]=None):
if not truth:
raise CompilerBugError(message)

View file

@ -444,7 +444,7 @@ class Match(ParseNode):
token = ctx.next_token()
return str(token) == self.op
def expected(self, expect: str = None):
def expected(self, expect: T.Optional[str] = None):
""" Convenience method for err(). """
if expect is None:
return self.err(f"Expected '{self.op}'")