-
Notifications
You must be signed in to change notification settings - Fork 10
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:
Prefix private/protected members with _.
...
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.
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.