subtle cache corruption when using dataclass transform leading to `Cannot determine type of "<my-dataclass-transform>" [has-type]` and a big complicated codebase (Pomodouroboros)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Pomodouroboros commit and src/pomodouroboros/model/sessions.py, then run mypy src/pomodouroboros/model/sessions.py and mypy src/ as described. Compare the results with and without the @observable() change, using the reported mypy and Python versions. Done means the cache-related error is reproducible and resolved consistently for both invocation scopes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100