Python
Guida di stile Python completa per progetti PANDEV general purpose, con Black, flake8 e mypy per qualitΓ e type safety.
π― Overview
Python Γ¨ utilizzato per progetti general purpose in PANDEV. Questa guida copre:
General Purpose: Scripting, web development, data science, automation
Tools: Black, flake8, mypy, isort
Versions: Python 3.9+ e 3.11+
Best Practices: PEP 8, type hints, testing
π Standard Adottati
Formatter: Black
Black per formattazione automatica del codice:
# pyproject.toml
[tool.black]
line-length = 100
target-version = ['py39', 'py311']
include = '\.pyi?$'
extend-exclude = '''
/(
migrations
| venv
| \.venv
)/
'''Linter: flake8
flake8 per code quality e PEP 8 compliance:
Type Checker: mypy
mypy per type checking statico:
π οΈ Setup Rapido
1. Installazione Dependencies
2. File pyproject.toml PANDEV
3. File .flake8
4. Scripts e Makefile
π Python Version Support
Multi-Version Development
Version-Specific Features
π Code Style Guidelines
1. Type Hints
2. Naming Conventions
3. Error Handling
ποΈ Project Structure
Recommended Structure
init.py Pattern
π§ͺ Testing Guidelines
pytest Configuration
Test Examples
π Performance Best Practices
Efficient Code Patterns
π§ Development Tools Integration
Pre-commit Hooks
VS Code Configuration
π Risorse
Documentazione Ufficiale
Python Version Guides
Per configurazioni dettagliate, consulta le sezioni dedicate:
Last updated
Was this helpful?