Skip to content

Commit 61b8b5b

Browse files
committed
TYP: annotation of __init__ return type (PEP 484) (pandas/utils)
1 parent d0cf9b5 commit 61b8b5b

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

pandas/core/indexes/multi.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,9 +1088,7 @@ def _engine(self):
10881088
# equivalent to sorting lexicographically the codes themselves. Notice
10891089
# that each level needs to be shifted by the number of bits needed to
10901090
# represent the _previous_ ones:
1091-
offsets = np.concatenate([lev_bits[1:], [0]]).astype( # type: ignore[arg-type]
1092-
"uint64"
1093-
)
1091+
offsets = np.concatenate([lev_bits[1:], [0]]).astype("uint64")
10941092

10951093
# Check the total number of bits needed for our representation:
10961094
if lev_bits[0] > 64:

pandas/util/_decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def some_function(x):
435435
"%s %s wrote the Raven"
436436
"""
437437

438-
def __init__(self, *args, **kwargs):
438+
def __init__(self, *args, **kwargs) -> None:
439439
if args and kwargs:
440440
raise AssertionError("Only positional or keyword args are allowed")
441441

@@ -475,7 +475,7 @@ def my_dog(has='fleas'):
475475

476476
addendum: str | None
477477

478-
def __init__(self, addendum: str | None, join: str = "", indents: int = 0):
478+
def __init__(self, addendum: str | None, join: str = "", indents: int = 0) -> None:
479479
if indents > 0:
480480
self.addendum = indent(addendum, indents=indents)
481481
else:

pandas/util/_doctools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(
1616
cell_width: float = 0.37,
1717
cell_height: float = 0.25,
1818
font_size: float = 7.5,
19-
):
19+
) -> None:
2020
self.cell_width = cell_width
2121
self.cell_height = cell_height
2222
self.font_size = font_size

0 commit comments

Comments
 (0)