From e7fefd8dca2c9b338b17ece4de85e629ad66ffe8 Mon Sep 17 00:00:00 2001 From: Keith Erskine Date: Wed, 5 Apr 2023 19:51:45 -0500 Subject: [PATCH] don't use TypeAlias (#1191) --- src/pyodbc.pyi | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/pyodbc.pyi b/src/pyodbc.pyi index 5cf5b698..7420e3d3 100644 --- a/src/pyodbc.pyi +++ b/src/pyodbc.pyi @@ -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 @@ -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: @@ -544,6 +539,8 @@ class Cursor: 4. precision 5. scale 6. nullable (True/False) + + ref: https://peps.python.org/pep-0249/#description """ ... @@ -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.""" ...