1 # SPDX-License-Identifier: GPL-2.0-only
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2022 by the Nominatim developer community.
6 # For a full list of authors see the git log.
8 Type definitions for typing annotations.
10 Complex type definitions are moved here, to keep the source files readable.
12 from typing import Union, TypeVar, TYPE_CHECKING
14 # Generics varaible names do not confirm to naming styles, ignore globally here.
15 # pylint: disable=invalid-name
19 import psycopg2.extensions
22 StrPath = Union[str, 'os.PathLike[str]']
24 # psycopg2-related types
26 Query = Union[str, bytes, 'psycopg2.sql.Composable']
27 T_cursor = TypeVar('T_cursor', bound='psycopg2.extensions.cursor')