Skip to content

Commit 1acc290

Browse files
Jackenmendonbarbos
andauthored
Fix wrong types for xlrd.(Cell.value|Sheet.get_rows) (#14894)
--------- Co-authored-by: Semyon Moroz <[email protected]>
1 parent 11c7821 commit 1acc290

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stubs/xlrd/xlrd/sheet.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _typeshed import SupportsWrite
22
from array import array
3-
from collections.abc import Callable, Sequence
3+
from collections.abc import Callable, Generator, Sequence
44
from typing import Any, Final, Literal, overload
55

66
from .biffh import *
@@ -43,10 +43,10 @@ ctype_text: Final[dict[int, str]]
4343

4444
class Cell(BaseObject):
4545
__slots__ = ["ctype", "value", "xf_index"]
46-
ctype: int
47-
value: str
46+
ctype: Literal[0, 1, 2, 3, 4, 5, 6]
47+
value: str | float
4848
xf_index: int | None
49-
def __init__(self, ctype: int, value: str, xf_index: int | None = None) -> None: ...
49+
def __init__(self, ctype: Literal[0, 1, 2, 3, 4, 5, 6], value: str, xf_index: int | None = None) -> None: ...
5050

5151
empty_cell: Final[Cell]
5252

@@ -147,7 +147,7 @@ class Sheet(BaseObject):
147147
def __getitem__(self, item: int) -> list[Cell]: ...
148148
@overload
149149
def __getitem__(self, item: tuple[int, int]) -> Cell: ...
150-
def get_rows(self) -> tuple[list[Cell], ...]: ...
150+
def get_rows(self) -> Generator[list[Cell]]: ...
151151
__iter__ = get_rows
152152
def row_types(self, rowx: int, start_colx: int = 0, end_colx: int | None = None) -> Sequence[int]: ...
153153
def row_values(self, rowx: int, start_colx: int = 0, end_colx: int | None = None) -> Sequence[str]: ...

0 commit comments

Comments
 (0)