diff --git a/parso/python/token.py b/parso/python/token.py index be2b13c..eda08f1 100644 --- a/parso/python/token.py +++ b/parso/python/token.py @@ -4,7 +4,10 @@ from enum import Enum class TokenType(object): - def __init__(self, name, contains_syntax=False): + name: str + contains_syntax: bool + + def __init__(self, name: str, contains_syntax: bool = False): self.name = name self.contains_syntax = contains_syntax diff --git a/parso/python/token.pyi b/parso/python/token.pyi deleted file mode 100644 index 48e8dac..0000000 --- a/parso/python/token.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from typing import Container, Iterable - -class TokenType: - name: str - contains_syntax: bool - def __init__(self, name: str, contains_syntax: bool) -> None: ... - -class TokenTypes: - def __init__( - self, names: Iterable[str], contains_syntax: Container[str] - ) -> None: ... - -# not an actual class in the source code, but we need this class to type the fields of -# PythonTokenTypes -class _FakePythonTokenTypesClass(TokenTypes): - STRING: TokenType - NUMBER: TokenType - NAME: TokenType - ERRORTOKEN: TokenType - NEWLINE: TokenType - INDENT: TokenType - DEDENT: TokenType - ERROR_DEDENT: TokenType - FSTRING_STRING: TokenType - FSTRING_START: TokenType - FSTRING_END: TokenType - OP: TokenType - ENDMARKER: TokenType - -PythonTokenTypes: _FakePythonTokenTypesClass = ...