Skip to content

Multimethod on __init__ fails mypy #38

Description

@marcus7070

With a test.py containing:

from multimethod import multimethod


class Test:

    @multimethod
    def __init__(self) -> None:
        pass

    @__init__.register
    def _(self, a: int) -> None:
        pass
> mypy test.py
test.py:6: error: Unsupported decorated constructor type
Found 1 error in 1 file (checked 1 source file)

Can I multimethod an __init__ (and pass mypy)? Sorry if I'm missing anything obvious, I'm just getting started with multiple dispatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions