-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: mostly missing return annotations in IO #44801
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
Conversation
def to_clipboard(obj, excel=True, sep=None, **kwargs): # pragma: no cover | ||
def to_clipboard( | ||
obj, excel: bool | None = True, sep: str | None = None, **kwargs | ||
) -> None: # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is # pragma: no cover
for codecov? Does it need to be on the def to_clipboard
-line?
@@ -170,7 +170,7 @@ def _expand_user(filepath_or_buffer: str | BaseBufferT) -> str | BaseBufferT: | |||
return filepath_or_buffer | |||
|
|||
|
|||
def validate_header_arg(header) -> None: | |||
def validate_header_arg(header: object) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be Any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typeshed recommends to use Any
when it is too difficult to create a type annotations. object
should be used if literally any object can be accepted.
https://github.com/python/typeshed/blob/master/CONTRIBUTING.md#conventions
Note that Any is not the correct type to use if you want to indicate that some function can accept literally anything: in those cases use object instead.
pandas/io/html.py
Outdated
@@ -116,6 +116,7 @@ def _get_skiprows(skiprows: int | Sequence[int] | slice | None): | |||
start, step = skiprows.start or 0, skiprows.step or 1 | |||
return list(range(start, skiprows.stop, step)) | |||
elif isinstance(skiprows, numbers.Integral) or is_list_like(skiprows): | |||
assert skiprows is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make this a cast
? that way mypy will alert us once it is unnecessary
No description provided.