forked from 0xWheatyz/SPARC
Fix Patent.patent_id type annotation from int to str in types.py #935
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Summary
Patent.patent_idis annotated asintintypes.pybut used as astrthroughout the codebase. This type mismatch causes mypy/pyright errors and can lead to subtle bugs at runtime.Roadmap Reference
P2 Backend -- Patent.patent_id typed as int but used as str everywhere (ROADMAP.md)
What to do
types.py, change the annotation ofPatent.patent_idfrominttostr.int()casts onpatent_idand remove them.mypy(orpyright) to confirm no new type errors are introduced.Acceptance criteria
Patent.patent_idis annotated asstrintypes.py.intcasts onpatent_idremain in the codebase.mypy src/exits 0 (or the error count does not increase).This issue has been resolved.
SPARC/types.pyline 7 showspatent_id: str— the type annotation is alreadystr, notint. Closing as completed.