add type annotations for legacy tokenizer

This commit is contained in:
Sarah Hoffmann
2022-07-15 22:52:26 +02:00
parent e37cfc64d2
commit 18b16e06ca
3 changed files with 83 additions and 62 deletions

View File

@@ -7,7 +7,7 @@
"""
Specialised connection and cursor functions.
"""
from typing import List, Optional, Any, Callable, ContextManager, Dict, cast, overload, Tuple
from typing import Optional, Any, Callable, ContextManager, Dict, cast, overload, Tuple, Iterable
import contextlib
import logging
import os
@@ -36,7 +36,7 @@ class Cursor(psycopg2.extras.DictCursor):
super().execute(query, args)
def execute_values(self, sql: Query, argslist: List[Any],
def execute_values(self, sql: Query, argslist: Iterable[Tuple[Any, ...]],
template: Optional[str] = None) -> None:
""" Wrapper for the psycopg2 convenience function to execute
SQL for a list of values.