Skip to content

Caching errors with latest version of mypy #76

@euresti

Description

@euresti

Hi. With the latest version of mypy and mypy-zope we're getting mypy errors that I think are cache related. The error goes away after rm -rf .mypy_cache

Here's the smallest repro I could make:

src/zg/foo.py:

from zg.bar import ZGScriptProtocol

print(ZGScriptProtocol.transport)

src/zg/bar.py:

from twisted.internet.protocol import ProcessProtocol

class ZGScriptProtocol(ProcessProtocol):
    pass

I am able to reliably hit the problem by running the following commands:

$ rm -rf .mypy_cache
$ mypy src/zg/foo.py 
Success: no issues found in 1 source file
$ mypy src/zg/foo.py src/zg/bar.py 
src/zg/bar.py:3: error: Cannot determine consistent method resolution order (MRO) for "ZGScriptProtocol"
src/zg/foo.py:3: error: "Type[ZGScriptProtocol]" has no attribute "transport"
$ mypy --version
mypy 0.971 (compiled: yes)

mypy-zope==0.3.9 and twisted[tls]==22.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions