Skip to content

Coding standards

Paul Nechifor edited this page Feb 5, 2026 · 1 revision

Coding standards should mostly be enforced by mypy and ruff but some things are worth mentioning:

Adopted

1. _private

Prefix private/protected members with _.

2. Modules

...

Proposals

1. Bare Exception

Only use except Exception if you truly expect anything to fail. LLMs tend to generate code which handles all possible errors, even when it's better to just fail on unknown issues rather than pass and continue processing even when the system is in an inconsistent state.

2. Long try-except

When a try-except wraps a long sequence of code it's unclear what part of it is expected to fail. It's better to wrap the specific part that triggers the exception.

Clone this wiki locally