Skip to content

Error for metaclass conflict could be improved #6176

Closed

Description

@erictraut

When a metaclass conflict occurs, the current error message doesn't provide any details about which metaclasses are conflicting.

class Meta1(type): ...
class Base1(metaclass=Meta1): ...

class Meta2(type): ...
class Base2(metaclass=Meta2): ...

class Child(Base1, Base2): ... # Error: metaclass conflict

It would be helpful if pyright included the conflicting metaclasses to help in the diagnosis of the error.

Activity

  1. erictraut commented on Oct 16, 2023

    @erictraut
    CollaboratorAuthor

    The message now includes the metaclasses:

    image

  2. erictraut commented on Oct 18, 2023

    @erictraut
    CollaboratorAuthor

    This is included in pyright 1.1.332, which I just published. It will also be included in a future release of pylance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions