Shoobx / mypy-zope

Plugin for mypy to support zope.interface
MIT License
39 stars 13 forks source link

Fix the MRO order and correctly add metaclass types #88

Closed euresti closed 1 year ago

euresti commented 1 year ago

This fixes the caching error at #86 by ensuring that the faketi has the same metaclass_type as the TypeInfo that is being faked. I also adjusted the MRO so that builtins.object is correctly ignored by the mypy code. (It expected the MRO to end with builtins.object)

Note: This does not fix the fact that mypy 1.0.0 will show a:

error: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases [misc]

This only ensures that error shows up every time so that it can be # type: ignored if you want.

Closes #86

euresti commented 1 year ago

Assertion added. Thanks!

kedder commented 1 year ago

Ok, this assertion caused a meltdown on master when combined with #89... What a coincidence!

kedder commented 1 year ago

actually, it is not that assertion, disregard...