Skip to content

Commit bc9b2f0

Browse files
peterlvilimgvanrossum
authored andcommitted
Fix signature for slite3.fetchmany (#1444)
Also made pymssql.fetchmany simpler.
1 parent ac87de5 commit bc9b2f0

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

stdlib/2/sqlite3/dbapi2.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Filip Hron <filip.hron@gmail.com>
22
# based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py
33

4-
from typing import Any, Union, List, Iterator
5-
from numbers import Integral
4+
from typing import Any, Union, List, Iterator, Optional
65
from datetime import time, datetime
76
from collections import Iterable
87

@@ -141,7 +140,7 @@ class Cursor(Iterator[Any]):
141140
def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]): ...
142141
def executescript(self, sql_script: Union[bytes, unicode]) -> Cursor: ...
143142
def fetchall(self) -> List[Any]: ...
144-
def fetchmany(self, size: Integral = ...) -> List[Any]: ...
143+
def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ...
145144
def fetchone(self) -> Any: ...
146145
def setinputsizes(self, *args, **kwargs): ...
147146
def setoutputsize(self, *args, **kwargs): ...

stdlib/3/sqlite3/dbapi2.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import sys
55
from typing import Any, Union, List, Iterator, Optional, TypeVar, Callable
6-
from numbers import Integral
76
from datetime import time, datetime
87
from collections import Iterable
98

@@ -141,7 +140,7 @@ class Cursor(Iterator[Any]):
141140
def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable]): ...
142141
def executescript(self, sql_script: Union[bytes, str]) -> Cursor: ...
143142
def fetchall(self) -> List[Any]: ...
144-
def fetchmany(self, size: Integral = ...) -> List[Any]: ...
143+
def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ...
145144
def fetchone(self) -> Any: ...
146145
def setinputsizes(self, *args, **kwargs): ...
147146
def setoutputsize(self, *args, **kwargs): ...

third_party/2/pymssql.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Cursor(object):
2626
def executemany(self, stmt: str,
2727
params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ...
2828
def fetchall(self) -> List[Result]: ...
29-
def fetchmany(self, size: Optional[Union[int, None]]) -> List[Result]: ...
29+
def fetchmany(self, size: Optional[int]) -> List[Result]: ...
3030
def fetchone(self) -> Result: ...
3131

3232
def connect(server: Optional[str],

0 commit comments

Comments
 (0)