subtle cache corruption when using dataclass transform leading to `Cannot determine type of "<my-dataclass-transform>" [has-type]` and a big complicated codebase (Pomodouroboros)
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug Report
This commit https://github.com/glyph/Pomodouroboros/commit/0d72cbb5079c87e3727a507c7752d1b053665abb prevents a mypy error, while making no semantic changes.
To Reproduce
Unfortunately I cannot construct a minimal reproducer.
- Check out that commit, replace the call to
observify(SessionManager)with@observable()above the declaration ofSessionManager. mypy src/pomodouroboros/model/sessions.py-> no errormypy src/->src/pomodouroboros/model/sessions.py:150: error: Cannot determine type of "observable" [has-type] Found 1 error in 1 file (checked 58 source files)- notice the error.
Expected Behavior
I would expect no error here, or at the very least, the same error with or without running mypy on the rest of the codebase.
Actual Behavior
See above.
Your Environment
- Mypy version used:
mypy 1.19.1 (compiled: yes) - Mypy command-line flags: none
- Mypy configuration options from
mypy.ini(and other config files): see project - Python version used: 3.13.12
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem Pomodouroboros-Commit und src/pomodouroboros/model/sessions.py und führe dann wie beschrieben mypy src/pomodouroboros/model/sessions.py und mypy src/ aus. Vergleiche die Ergebnisse mit und ohne die Änderung an @observable() unter Verwendung der gemeldeten mypy- und Python-Versionen. Als erledigt gilt es, wenn der cachebezogene Fehler reproduzierbar ist und für beide Aufrufbereiche konsistent behoben wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100