python
Installation
SKILL.md
Python Skill
Concepts are related to PHP, Java, and Ruby where helpful. Keep code simple and readable — follow the Zen of Python.
Style & Conventions (PEP 8 + ruff)
- 4-space indentation (unlike Ruby's 2 spaces).
- Follow PEP 8 strictly; enforce with ruff (
ruff check+ruff format). - Always follow the repository's existing
ruffconfig — do not override rules project-wide. - snake_case for functions/variables, PascalCase for classes, UPPER_SNAKE_CASE for constants.
- Use type hints for all function signatures and variable declarations (PHP-style: think typed properties).
- Use f-strings:
f"Hello, {name}"(like Ruby's"Hello, #{name}"). from __future__ import annotationsfor forward references (Python < 3.10).