feat: FT207 collections — namedtuple / defaultdict / Counter / deque#575
Merged
Conversation
…loses #574) - namedtuple: Point / RGB 軽量 Value Object(API 境界は dataclass で型安全に) - defaultdict: 単語頻度集計・先頭文字グループ化(返却は dict 変換を徹底) - Counter: 文字頻度集計・差分計算(- 演算は 0 以下除去を確認) - deque: 双方向キュー操作・固定容量リングバッファ(maxlen 上限 10000 設定) - セキュリティ診断合格(207 % 3 = 0): 全入力制限・インジェクションなし - 29 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
namedtuple: Point / RGB 軽量 Value Object — API 境界はdataclass(frozen=True, slots=True)で型安全にdefaultdict: 単語頻度集計 / 先頭文字グループ化 — 返却は必ずdict(...)に変換Counter: 文字頻度集計 / 差分計算 —-演算は 0 以下を自動除去(subtract()との違い確認)deque: 双方向キュー操作 / 固定容量リングバッファ —maxlen上限 10,000 設定max_length制限・外部リソースアクセスなしCloses #574
Test plan
uv run pytest— 29 passed in sandboxuv run mypy— no issuesuv run ruff check/ruff format --check— all passed🤖 Generated with Claude Code