Skip to content

2.2.0 Throws Exception for class with custom metaclass #462

@b-phi

Description

@b-phi

Handler <function process_docstring at 0x7f12ae4c8b80> for event 'autodoc-process-docstring' threw an exception (exception: unhashable type: '_SchemaMeta')

I've including the relevant skeleton of the classes below.

class _SchemaMeta(type):
    def __new__(mcs, *args: Any, **kwargs: Any) -> '_SchemaMeta':
        # some logic
        return schema_cls

    def __eq__(cls, other: Any) -> bool:
        ...

class Schema(metaclass=_SchemaMeta):
    ...

Elsewhere in the code, we have this which causes the error

class Foo:
    def do_something(self, schema: Schema) -> None:
        """
        Args:
            schema: Some schema.
        """
        ...

Edit: I've pinned to 2.1.1 for now, which doesn't throw an error in this case.

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