Skip to content

Commit 27a1ece

Browse files
author
MarcoGorelli
committed
let __getitem__ take sequence of int
1 parent 8b2413b commit 27a1ece

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

spec/API_specification/dataframe_api/column_object.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
from typing import NoReturn
1+
from __future__ import annotations
2+
3+
from typing import NoReturn, overload, Sequence
24

35
class Column:
46
def __len__(self) -> int:
57
"""
68
Return the number of rows.
79
"""
810

9-
def __getitem__(self, row: int) -> object:
11+
@overload
12+
def __getitem__(self, key: int) -> object:
13+
...
14+
15+
@overload
16+
def __getitem__(self, key: Sequence[int]) -> Column:
17+
...
18+
19+
def __getitem__(self, key: int | Sequence[int]) -> object | Column:
1020
"""
11-
Get the element at row index `row`.
21+
Get the element at row index `key`.
1222
"""
1323

1424
def __iter__(self) -> NoReturn:

0 commit comments

Comments
 (0)