File: _typing.py

package info (click to toggle)
sqlglot 27.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 96,512 kB
  • sloc: python: 73,917; sql: 20,291; javascript: 40; makefile: 39
file content (17 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from __future__ import annotations

import typing as t

import sqlglot

if t.TYPE_CHECKING:
    from typing_extensions import Literal as Lit  # noqa

# A little hack for backwards compatibility with Python 3.7.
# For example, we might want a TypeVar for objects that support comparison e.g. SupportsRichComparisonT from typeshed.
# But Python 3.7 doesn't support Protocols, so we'd also need typing_extensions, which we don't want as a dependency.
A = t.TypeVar("A", bound=t.Any)
B = t.TypeVar("B", bound="sqlglot.exp.Binary")
E = t.TypeVar("E", bound="sqlglot.exp.Expression")
F = t.TypeVar("F", bound="sqlglot.exp.Func")
T = t.TypeVar("T")