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

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?