feat: FT209 functools — partial / lru_cache / reduce / wraps#581
Merged
Conversation
…580) - partial: キーワード引数固定の累乗関数(ファクトリパターン) - lru_cache: 再帰フィボナッチのメモ化(fib(50)を51回の計算で達成) - reduce: sum/product/max/min の逐次集約(初期値必須パターン確立) - wraps: デコレータのメタデータ保持(__name__/__doc__/__wrapped__) - Python 3.14: @wraps 使用時の type: ignore が不要になることを確認 - *args: object でANN401違反回避(Any は禁止) - 22 tests passed / mypy strict / ruff clean Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
partial: キーワード引数固定の累乗関数(ファクトリパターンの実証)lru_cache: 再帰フィボナッチのメモ化 — fib(50) を 51 回の計算で達成reduce: sum / product / max / min の逐次集約(初期値必須パターン確立)wraps: デコレータのメタデータ保持(__name__/__doc__/__wrapped__)@wraps使用時のtype: ignore[return-value]が不要になることを確認*args: objectで ruff ANN401 違反を回避(Anyは禁止)Closes #580
Test plan
uv run pytest— 22 passed in sandboxuv run mypy— no issuesuv run ruff check/ruff format --check— all passed🤖 Generated with Claude Code