Skip to content
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

Fix *args as positional arguments #597

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion doc/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ When documenting variable length positional, or keyword arguments, leave the
leading star(s) in front of the name and do not specify a type::

*args
Additional arguments should be passed as keyword arguments
Additional arguments should be passed as positional arguments.
**kwargs
Extra arguments to `metric`: refer to each metric documentation for a
list of all possible arguments.
Comment on lines -231 to 234
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for highlighting this confusing phrasing, @mwtoews.

Since this example is entirely made up, I was wondering if we can't come up with something more intuitive. E.g.:

def red_print(*args, **kwargs):
   """Print text in red.

   Parameters
   ----------
   *args
       Positional arguments, passed to `print`.
   **kwargs
       Keyword arguments, passed to `print`.
   ...

This is not the best example, but it's late :) Something more computational would be good.

I think this was the original goal with the metric usage in **kwargs, but it doesn't really come across.

Expand Down
Loading