Skip to content

DOC: Fix to lzma.LZMAFile #30010

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 5 commits into from
Dec 4, 2019
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _get_lzma_file(lzma):

Returns
-------
class
lzma.LZMAFile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly type(LZMAFile)? usually this would indicate that we're getting an instance of that class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should annotate the function return here as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should annotate the function return here as well

I thought of that. but the problem is that the function tests for the imports of the lzma module. If I import it beforehand it kinda losing it's point (I think)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should annotate the function return here as well

@WillAyd I tried it now, I imported the lzma module at the beginning of the file and annotated _get_lzma_file with -> lzma.LZMAFile, and mypy complained:

pandas/io/common.py:468: error: "LZMAFile" not callable

Any thoughts?

The lzma.LZMAFile class.

Raises
Expand Down