From bcc076a6e110c22f248338f8073dd75f769c21a0 Mon Sep 17 00:00:00 2001 From: Peter Vilim Date: Thu, 29 Jun 2017 13:19:59 -0700 Subject: [PATCH] Fix signature for slite3.fetchmany Also made pymssql.fetchmany simpler. --- stdlib/2/sqlite3/dbapi2.pyi | 5 ++--- stdlib/3/sqlite3/dbapi2.pyi | 3 +-- third_party/2/pymssql.pyi | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/stdlib/2/sqlite3/dbapi2.pyi b/stdlib/2/sqlite3/dbapi2.pyi index bd4443323d9d..8d55e04a664f 100644 --- a/stdlib/2/sqlite3/dbapi2.pyi +++ b/stdlib/2/sqlite3/dbapi2.pyi @@ -1,8 +1,7 @@ # Filip Hron # based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py -from typing import Any, Union, List, Iterator -from numbers import Integral +from typing import Any, Union, List, Iterator, Optional from datetime import time, datetime from collections import Iterable @@ -141,7 +140,7 @@ class Cursor(Iterator[Any]): def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]): ... def executescript(self, sql_script: Union[bytes, unicode]) -> Cursor: ... def fetchall(self) -> List[Any]: ... - def fetchmany(self, size: Integral = ...) -> List[Any]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ... def fetchone(self) -> Any: ... def setinputsizes(self, *args, **kwargs): ... def setoutputsize(self, *args, **kwargs): ... diff --git a/stdlib/3/sqlite3/dbapi2.pyi b/stdlib/3/sqlite3/dbapi2.pyi index ea1e28dba330..fc748e2da9df 100644 --- a/stdlib/3/sqlite3/dbapi2.pyi +++ b/stdlib/3/sqlite3/dbapi2.pyi @@ -3,7 +3,6 @@ import sys from typing import Any, Union, List, Iterator, Optional, TypeVar, Callable -from numbers import Integral from datetime import time, datetime from collections import Iterable @@ -141,7 +140,7 @@ class Cursor(Iterator[Any]): def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]): ... def executescript(self, sql_script: Union[bytes, str]) -> Cursor: ... def fetchall(self) -> List[Any]: ... - def fetchmany(self, size: Integral = ...) -> List[Any]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ... def fetchone(self) -> Any: ... def setinputsizes(self, *args, **kwargs): ... def setoutputsize(self, *args, **kwargs): ... diff --git a/third_party/2/pymssql.pyi b/third_party/2/pymssql.pyi index 3f75b313dc39..a35b050c9ea2 100644 --- a/third_party/2/pymssql.pyi +++ b/third_party/2/pymssql.pyi @@ -26,7 +26,7 @@ class Cursor(object): def executemany(self, stmt: str, params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ... def fetchall(self) -> List[Result]: ... - def fetchmany(self, size: Optional[Union[int, None]]) -> List[Result]: ... + def fetchmany(self, size: Optional[int]) -> List[Result]: ... def fetchone(self) -> Result: ... def connect(server: Optional[str],