diff options
Diffstat (limited to 'ptpython/lexer.py')
-rw-r--r-- | ptpython/lexer.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ptpython/lexer.py b/ptpython/lexer.py index 62e470f..d925e95 100644 --- a/ptpython/lexer.py +++ b/ptpython/lexer.py @@ -1,4 +1,6 @@ -from typing import Callable, Optional +from __future__ import annotations + +from typing import Callable from prompt_toolkit.document import Document from prompt_toolkit.formatted_text import StyleAndTextTuples @@ -17,7 +19,7 @@ class PtpythonLexer(Lexer): use a Python 3 lexer. """ - def __init__(self, python_lexer: Optional[Lexer] = None) -> None: + def __init__(self, python_lexer: Lexer | None = None) -> None: self.python_lexer = python_lexer or PygmentsLexer(PythonLexer) self.system_lexer = PygmentsLexer(BashLexer) |