8000 Function signatures should use slash/star as needed by nedbat · Pull Request #1344 · python/devguide · GitHub
[go: up one dir, main page]

Skip to content

Function signatures should use slash/star as needed #1344

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
Jul 12, 2024
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
Prev Previous commit
explain more about the reason to use slash/star
  • Loading branch information
nedbat committed Jul 11, 2024
commit da1b11ae0706c7b7234cf0a63ee024374c3d8b66
8 changes: 7 additions & 1 deletion documentation/style-guide.rst
8F27
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ such as "for example" or "that is."


.. index:: diataxis
.. _diataxis:

Diátaxis
========
Expand Down Expand Up @@ -295,9 +296,14 @@ making false assumptions about the language ("I was surprised by ...").
Function signatures
===================

These are the evolving guidelines for how to include function signatures in the docs:
These are the evolving guidelines for how to include function signatures in the
reference guide. As outlined in :ref:`diataxis`, reference material should
prioritize precision and completeness.

- If a function accepts positional-only or keyword-only arguments, include the
slash and the star in the signature as appropriate::

.. function:: some_function(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):

Although the syntax is terse, it is precise about the allowable ways to call
the function and is taken from Python itself.
Loading
0