-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching error (Metaclass conflict) with mypy 0.991 #86
Comments
I also encountered an apparently cache-related issue, and got this internal traceback:
This revision of this repo, if it helps: |
I think 0.991 is not yet supported by mypy-zope. There are some problems (in #82) that we haven't found a workaround for yet. |
Ok I did a little research into this and I see 2 bugs. But fixing both wouldn't actually fix the issue. :) The thing that is emitting the error is check_metaclass_compatibility In particular the line:
returns Now bug #1 is that it only fails for two or more Interfaces. This is because we append the types to the MRO like this: Bug #2 is that we append a However in the cache mypy ends up writing references like this:
And when it loads from the cache the real ISomething type info is loaded which does have the So I'm not sure where to go from here. The only thing I can think of is somehow setting the metaclass_type of Good and Bad to |
I do think that this is a bigger problem than #82 which a) Doesn't affect everyone (since it only affects projects that create Interfaces not that just use them) and b) I believe you can temporarily add a |
Hi. With the latest version of mypy (0.991) and mypy-zope (0.3.11) we're getting mypy errors that I think are cache related. The error goes away after
rm -rf .mypy_cache
Here's the easiest repro I could make:
iface.py
foo.py
I am able to reliably hit the problem by running the following commands:
As you can tell this only happens when there are multiple interfaces.
The text was updated successfully, but these errors were encountered: