ECC/docs/tr/rules/python/coding-style.md

43 lines
775 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
paths:
- "**/*.py"
- "**/*.pyi"
---
# Python Kodlama Stili
> Bu dosya [common/coding-style.md](../common/coding-style.md) dosyasını Python'a özgü içerikle genişletir.
## Standartlar
- **PEP 8** konvansiyonlarını takip et
- Tüm fonksiyon imzalarında **type annotation'lar** kullan
## Immutability
Immutable veri yapılarını tercih et:
```python
from dataclasses import dataclass
@dataclass(frozen=True)
class User:
name: str
email: str
from typing import NamedTuple
class Point(NamedTuple):
x: float
y: float
```
## Formatlama
- Kod formatlama için **black**
- Import sıralama için **isort**
- Linting için **ruff**
## Referans
Kapsamlı Python idiom'ları ve pattern'leri için skill: `python-patterns` dosyasına bakın.