Skip to content

subtle cache corruption when using dataclass transform leading to Cannot determine type of "<my-dataclass-transform>" [has-type] and a big complicated codebase (Pomodouroboros) #21043

@glyph

Description

@glyph

Bug Report

This commit glyph/Pomodouroboros@0d72cbb prevents a mypy error, while making no semantic changes.

To Reproduce

Unfortunately I cannot construct a minimal reproducer.

  1. Check out that commit, replace the call to observify(SessionManager) with @observable() above the declaration of SessionManager.
  2. mypy src/pomodouroboros/model/sessions.py -> no error
  3. mypy 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)
    
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions