-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use str instead of string as type in docstrings #14716
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -437,7 +437,7 @@ def __init__(self, filename, metadata=None): | |
Parameters | ||
---------- | ||
|
||
filename : file-like object or string | ||
filename : str or path-like or file-like | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is chaining There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's how the numpydoc docstring guide describes it:
Currently we use a comma for simple tuples, e.g. I don't have a strong opinion on this, but if we change that, we need another convention for tuple to avoid ambiguity (could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you use the Oxford comma it’s not ambiguous: A, B, or c A, B or c Though I would tend to enclose tuples in brackets just to be clear |
||
Output target; if a string, a file will be opened for writing. | ||
metadata : dict from strings to strings and dates | ||
Information dictionary object (see PDF reference section 10.2.1 | ||
|
@@ -2472,7 +2472,7 @@ def __init__(self, filename, keep_empty=True, metadata=None): | |
|
||
Parameters | ||
---------- | ||
filename : str | ||
filename : str or path-like or file-like | ||
Plots using :meth:`PdfPages.savefig` will be written to a file at | ||
this location. The file is opened at once and any older file with | ||
the same name is overwritten. | ||
|
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.
also add missing final dots in the sentences below? (throughout the docstrings you edited here)
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.
Trying to not get carried away too far. Otherwise the PR gets endless and even more terrible to review. These sentences need rephrasing anyway. It's better to leave them alone for now and do everything in one go when I come back.