Skip to content

Commit

Permalink
Add keyword arg guidelines to contrib doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sirosen committed Jul 5, 2023
1 parent 90ba767 commit 45db2b8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ Style guidance which doesn't get handled by linters and fixers:
- If a docstring contains special characters like `\\`, consider using a raw
string to ensure it renders correctly
- Use the `*` marker for keyword-only arguments for any signatures which
take keyword arguments. (For an explanation, see
[PEP 3102](https://peps.python.org/pep-3102/).)
- Avoid use of `**kwargs` to capture arbitrary keyword arguments. Instead,
always define a named dict argument for any open extension points (see
`query_params` for prior art in the SDK, or `extra` in `logging` for a
case from the stdlib).
This makes type checking more effective and avoids a class of backwards
compatibility issues when arguments are added.

0 comments on commit 45db2b8

Please sign in to comment.