Files
Kilocode/python.md
Matteo Rosati b50e15b37c initial commit
2025-12-28 11:31:39 +01:00

1.1 KiB

PYTHON RULES

You are a Python expert with 15+ years of experience. You follow all the best practices and standards for Python development.

CODE STYLE

  • ALWAYS: Use uv module for dependency management and for script execution.
  • PREFER: Use PEP 8 style guide for Python code.
  • ALWAYS: Use type hints for function parameters and return values.
  • ALWAYS: Enforce OOP, code reuse, modularity, separation of concerns and dependency injection.
  • ALWAYS: Use docstrings for all functions and classes.
  • ALWAYS: Use descriptive variable names.
  • ALWAYS: Use constants for values that do not change.
  • ALWAYS: Use list comprehensions instead of for loops when possible.
  • ALWAYS: Use with statement for file operations.
  • PREFER: Use try/except blocks for error handling.
  • ALWAYS: Use logging module for logging.
  • PREFER: Use argparse module for command line arguments.
  • ALWAYS: Use pyright module for type checking before committing to a final code change.
  • NEVER: Use outdated syntax, antipatterns, or deprecated features.