diff --git a/blueprintcompiler/errors.py b/blueprintcompiler/errors.py index 70aea2a..e3bc787 100644 --- a/blueprintcompiler/errors.py +++ b/blueprintcompiler/errors.py @@ -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) diff --git a/blueprintcompiler/parse_tree.py b/blueprintcompiler/parse_tree.py index bc36415..0e2644b 100644 --- a/blueprintcompiler/parse_tree.py +++ b/blueprintcompiler/parse_tree.py @@ -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}'")