Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Tuple, TypeVar, overload
from typing import Any, Callable, TypeVar, overload
import psycopg2
import psycopg2.extensions
@@ -360,9 +360,9 @@ class cursor:
def copy_to(self, file, table, sep=..., null=..., columns=...): ...
def execute(self, query, vars=...): ...
def executemany(self, query, vars_list): ...
def fetchall(self) -> list[Tuple[Any, ...]]: ...
def fetchmany(self, size=...) -> list[Tuple[Any, ...]]: ...
def fetchone(self) -> Tuple[Any, ...] | Any: ...
def fetchall(self) -> list[tuple[Any, ...]]: ...
def fetchmany(self, size=...) -> list[tuple[Any, ...]]: ...
def fetchone(self) -> tuple[Any, ...] | Any: ...
def mogrify(self, *args, **kwargs): ...
def nextset(self): ...
def scroll(self, value, mode=...): ...

View File

@@ -1,5 +1,5 @@
from collections import OrderedDict
from typing import Any, List
from typing import Any
from psycopg2._ipaddress import register_ipaddress as register_ipaddress
from psycopg2._json import (
@@ -45,7 +45,7 @@ class DictCursor(DictCursorBase):
def execute(self, query, vars: Any | None = ...): ...
def callproc(self, procname, vars: Any | None = ...): ...
class DictRow(List[Any]):
class DictRow(list[Any]):
def __init__(self, cursor) -> None: ...
def __getitem__(self, x): ...
def __setitem__(self, x, v) -> None: ...