Skip to content

Commit

Permalink
don't use TypeAlias (#1191)
Browse files Browse the repository at this point in the history
  • Loading branch information
keitherskine authored Apr 6, 2023
1 parent 615ebdd commit e7fefd8
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/pyodbc.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
from __future__ import annotations
from typing import (
Any, Callable, Dict, Final, Generator, Iterable, Iterator,
List, Optional, Sequence, Tuple, TypeAlias, Union,
List, Optional, Sequence, Tuple, Union,
)

# ref: https://peps.python.org/pep-0249/#description
FieldDescription: TypeAlias = Tuple[str, Any, int, int, int, int, bool]
RowDescription: TypeAlias = Tuple[FieldDescription]



# SQLSetConnectAttr attributes
# ref: https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlsetconnectattr-function
Expand Down Expand Up @@ -533,7 +528,7 @@ class Cursor:
...

@property
def description(self) -> RowDescription:
def description(self) -> Tuple[Tuple[str, Any, int, int, int, int, bool]]:
"""The metadata for the columns returned in the last SQL SELECT statement, in
the form of a list of tuples. Each tuple contains seven fields:
Expand All @@ -544,6 +539,8 @@ class Cursor:
4. precision
5. scale
6. nullable (True/False)
ref: https://peps.python.org/pep-0249/#description
"""
...

Expand Down Expand Up @@ -912,7 +909,7 @@ class Row:
"""

@property
def cursor_description(self) -> RowDescription:
def cursor_description(self) -> Tuple[Tuple[str, Any, int, int, int, int, bool]]:
"""The metadata for the columns in this Row, as retrieved from the parent Cursor object."""
...

Expand Down

0 comments on commit e7fefd8

Please sign in to comment.