fix: correct Dict[str, any] to Dict[str, Any] in type annotations (#15) #31
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-card-creation#31
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/paper-dynasty-card-creation-15"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #15
Summary
Dict[str, any]in two function signatures referenced Python's builtinany()function instead oftyping.Any. This is a silent type annotation error — the annotation is technically valid Python but semantically wrong for type checkers.Changes
pitchers/creation.py: AddedAnytotypingimport; fixedcardset: Dict[str, any]→cardset: Dict[str, Any]batters/creation.py: AddedAnytotypingimport; fixedcardset: Dict[str, any]→cardset: Dict[str, Any]Test Results
No test suite in this repo. Changes verified by reading back modified files and confirming no remaining
Dict[str, any]occurrences in.pyfiles.AI Code Review
Files Reviewed
batters/creation.py(modified)pitchers/creation.py(modified)Findings
Correctness
Dict[str, any]referenced Python's builtinany()function (a callable) rather thantyping.Any. Type checkers like mypy would flag this as incorrect.Anyis now properly imported fromtypingin both files.post_player_updates(cardset: Dict[str, Any], ...)in both modules.Dict[str, any]occurrences in the changed files.Security
Style & Conventions
f'...'→f"...") across both files that are not mentioned in the PR title, body, or linked issue #15. These changes are all functionally equivalent and introduce no bugs, but they expand the scope beyond the stated fix. Future reviewers should be aware thatgit blameon these lines will point to this PR rather than the original authoring commit.Suggestions
Verdict: APPROVED
Clean, targeted type annotation fix. The core change is correct and the
Anyimport is properly added in both files. The incidental f-string quote normalization is harmless, though it goes undocumented.Automated review by Claude PR Reviewer
AI Code Review
Files Reviewed
batters/creation.py(modified)pitchers/creation.py(modified)Findings
Correctness
The primary fix is correct and complete.
Dict[str, any]referenced Python's built-inany()function — a valid but semantically wrong type annotation. Both files now importAnyfromtypingand useDict[str, Any]in thepost_player_updates()signature. No remainingDict[str, any]occurrences.The diff also includes several incidental f-string quote style cleanups (outer double quotes, inner single quotes) in both files. These are functionally identical to the originals — no behavioral change.
Security
No issues found. No new inputs, network calls, or data handling introduced.
Style & Conventions
The f-string quote style changes are consistent with PEP 8 preference for double-quoted outer strings. The
Anyimport is correctly placed alongside the existingDictimport on the same line (from typing import Any, Dict), keeping the import block tidy.Suggestions
None. The scope is appropriately narrow for a type annotation fix.
Verdict: APPROVED
Correct fix for a real (if silent) type annotation bug. The incidental f-string cleanups are safe and improve consistency. No logic changes, no behavioral risk.
Automated review by Claude PR Reviewer
Approved. Correct fix —
Anyfromtypingmust be capitalized;anyis a Python builtin, not a type alias.