python-patterns
Pythonic イディオム、PEP 8標準、型ヒント、堅牢で効率的かつ保守可能なPythonアプリケーションを構築するためのベストプラクティス。
Original · translation did not pass checksTarget: Software development & testing. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original Japanese text
Topics in the source
- Python開発パターン
- いつ有効化するか
- 核となる原則
- 1. 可読性が重要
- 2. 明示的は暗黙的より良い
- 3. EAFP - 許可を求めるより許しを請う方が簡単
- 型ヒント
- 基本的な型アノテーション
堅牢で効率的かつ保守可能なアプリケーションを構築するための慣用的なPythonパターンとベストプラクティス。 新しいPythonコードを書くとき Pythonコードをレビューするとき 既存のPythonコードをリファクタリングするとき Pythonパッケージ/モジュールを設計するとき Pythonは可読性を優先します。コードは明白で理解しやすいものであるべきです。 魔法を避け、コードが何をしているかを明確にしましょう。 Pythonは条件チェックよりも例外処理を好みます。 | イディオム | 説明 | |-------|-------------| | EAFP | 許可を求めるより許しを請う方が簡単 | | コンテキストマネージャ | リソース管理にはwithを使用 | | リスト内包表記 | 簡単な変換用 | | ジェネレータ | 遅延評価と大規模データセット用 | | 型ヒント | 関数シグネチャへのアノテーション | | データクラス | 自動生成メソッド付きデータコンテナ用 | | slots | メモリ最適化用 | | f-strings | 文字列フォーマット用(Python 3.6+) | | pathlib.Path | パス操作用(Python 3.4+) | | enumerate | ループ内のインデックス-要素ペア用 | 覚えておいてください: Pythonコードは読みやすく、明示的で、最小の驚きの原則に従うべきです。迷ったときは、巧妙さよりも明確さを優先してください。
- Source repository
- affaan-m/ECC
- Source file
- docs/ja-JP/skills/python-patterns/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:49.571Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.