Summary
The Lemma model in symproof/models.py uses bare mutable defaults for two fields:
- Line 385:
assumptions: dict[str, dict] = {}
- Line 418:
depends_on: list[str] = []
Impact
The model has frozen=True and Pydantic v2 internally copies defaults, so this is not a runtime bug. However, it violates Python best practice, will trigger linting warnings, and could confuse contributors.
Fix
from pydantic import Field
assumptions: dict[str, dict] = Field(default_factory=dict)
depends_on: list[str] = Field(default_factory=list)
Files
symproof/models.py:385,418
Summary
The
Lemmamodel insymproof/models.pyuses bare mutable defaults for two fields:assumptions: dict[str, dict] = {}depends_on: list[str] = []Impact
The model has
frozen=Trueand Pydantic v2 internally copies defaults, so this is not a runtime bug. However, it violates Python best practice, will trigger linting warnings, and could confuse contributors.Fix
Files
symproof/models.py:385,418