Skip to content

Subclasses of Twisted's protocol fail to be determined by mypy-zope #34

@clokep

Description

@clokep

Thanks for making mypy-zope! We've been using it for Synapse (which uses Twisted) and ran into a hiccup.

The following will cause mypy-zope to emit an error:

error: Cannot determine consistent method resolution order (MRO) for "Foo" [misc]

from twisted.internet import protocol

class Foo(protocol.Protocol):
    pass

reveal_type(Foo)

The class hierarchy looks like Foo -> Protocol (which implements IProtocol and ILoggingContext) -> BaseProtocol.

I tried to create a reduced test-case for this, but was not able to, so it might be specific to something Twisted has done. Any help would be appreciated!

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