diff options
author | Simon Heisterkamp <simon@heisterkamp.dk> | 2022-11-30 15:00:03 +0000 |
---|---|---|
committer | Andi Albrecht <albrecht.andi@gmail.com> | 2023-01-02 08:54:47 +0100 |
commit | 8515d2edd70fc16d69aa7b1094f9b3534dfa74d9 (patch) | |
tree | 867c9b95562c24796c63089cbf846247f87f02e5 /sqlparse | |
parent | e37eaea4a78cbb335070ffec018bfc28425aa1a4 (diff) | |
download | sqlparse-8515d2edd70fc16d69aa7b1094f9b3534dfa74d9.tar.gz |
remove type annotations for python 3.5 compatibility
Diffstat (limited to 'sqlparse')
-rw-r--r-- | sqlparse/keywords.py | 6 | ||||
-rw-r--r-- | sqlparse/lexer.py | 8 |
2 files changed, 2 insertions, 12 deletions
diff --git a/sqlparse/keywords.py b/sqlparse/keywords.py index ce53781..6bc7937 100644 --- a/sqlparse/keywords.py +++ b/sqlparse/keywords.py @@ -6,18 +6,12 @@ # the BSD License: https://opensource.org/licenses/BSD-3-Clause import re -from typing import Dict, List, Tuple, Callable, Union from sqlparse import tokens # object() only supports "is" and is useful as a marker PROCESS_AS_KEYWORD = object() -SQL_REGEX_TYPE = List[ - Tuple[Callable, Union[type(PROCESS_AS_KEYWORD), tokens._TokenType]] -] -KEYWORDS_TYPE = Dict[str, tokens._TokenType] - SQL_REGEX = { 'root': [ diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index 61c52a9..7408e01 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -13,7 +13,6 @@ # and to allow some customizations. from io import TextIOBase -from typing import List from sqlparse import tokens, keywords from sqlparse.utils import consume @@ -34,9 +33,6 @@ class Lexer(metaclass=_LexerSingletonMetaclass): """The Lexer supports configurable syntax. To add support for additional keywords, use the `add_keywords` method.""" - _SQL_REGEX: keywords.SQL_REGEX_TYPE - _keywords: List[keywords.KEYWORDS_TYPE] - def default_initialization(self): """Initialize the lexer with default dictionaries. Useful if you need to revert custom syntax settings.""" @@ -58,11 +54,11 @@ class Lexer(metaclass=_LexerSingletonMetaclass): self._SQL_REGEX = [] self._keywords = [] - def set_SQL_REGEX(self, SQL_REGEX: keywords.SQL_REGEX_TYPE): + def set_SQL_REGEX(self, SQL_REGEX): """Set the list of regex that will parse the SQL.""" self._SQL_REGEX = SQL_REGEX - def add_keywords(self, keywords: keywords.KEYWORDS_TYPE): + def add_keywords(self, keywords): """Add keyword dictionaries. Keywords are looked up in the same order that dictionaries were added.""" self._keywords.append(keywords) |