-
No Type Annotations: Never use type hints or annotations. Do not import from
typingmodule.- Document types in docstrings using Google-style format instead
-
Docstrings: Use Google-style docstrings
def example(name, count): """Brief description of function. Longer description if needed. Args: name: (str) Description of name parameter count: (int) Description of count parameter Returns: (bool) Description of return value Raises: ValueError: When something is wrong """
-
No init docstrings: Document initialization parameters in the class docstring, not in
__init__ -
Imports:
- Always
import compto access sibling modules through public interface - For internal cross-module access:
comp._sibling.internal_func() - Avoid
from X import Y- use qualified names likedecimal.Decimal - Import modules, not objects:
import decimalnotfrom decimal import Decimal
- Always
-
Naming:
- Use
snake_casefor functions, methods, variables - Use
PascalCasefor classes - Follow PEP 8 conventions strictly
- Use
-
Quotes: Always use double quotes
"for strings, never single quotes' -
Module structure:
- Internal modules are prefixed with underscore:
_value.py,_parse.py - Public API is exposed through
__init__.py
- Internal modules are prefixed with underscore:
- Clarity over performance - Optimize for understandability, not speed. Design for future efficiency but don't implement optimizations yet.
- Experimentation-friendly - Add debugging/inspection tools (flags, output modes) that make the system easy to explore and understand.
- Minimal scope - Don't add documentation files, extra features, or "nice to haves" unless explicitly requested.
- Ask, don't assume - When multiple valid approaches exist, ask for direction rather than making architectural decisions.