Skip to content

TYP: annotation of __init__ return type (PEP 484) (pandas/utils) #46276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/util/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def some_function(x):
"%s %s wrote the Raven"
"""

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

Expand Down Expand Up @@ -475,7 +475,7 @@ def my_dog(has='fleas'):

addendum: str | None

def __init__(self, addendum: str | None, join: str = "", indents: int = 0):
def __init__(self, addendum: str | None, join: str = "", indents: int = 0) -> None:
if indents > 0:
self.addendum = indent(addendum, indents=indents)
else:
Expand Down
2 changes: 1 addition & 1 deletion pandas/util/_doctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(
cell_width: float = 0.37,
cell_height: float = 0.25,
font_size: float = 7.5,
):
) -> None:
self.cell_width = cell_width
self.cell_height = cell_height
self.font_size = font_size
Expand Down