blob: d683152814f2ebd37534c1fd241e44e5ab0f7776 [file] [view]
# Python Conventions
## pytest
* Register helper fixtures using `pytest_plugins = ["<module_path>"]`.
* Name fixture functions with `fixture_` prefix and pass public name via
`@pytest.fixture(name="foo")`.
## CLI & Arguments
* Use direct attribute access (e.g. `args.foo`) on `argparse.Namespace` with
well-defined shapes. Avoid defensive `getattr()`.
## TypedDict
* **External Objects**: When defining a `TypedDict` for an external object,
link to its definition in the docstring.
## Delegating Functions
* Module-level functions delegating to class methods should have a docstring
referring to the class method (e.g. `"""Refer to \`Class.method\`."""`).