Skip to content

Cannot Subclass Error #4180

@czhang03

Description

@czhang03

I have a dummy base class:

class BaseModel:
    def __init__(self) -> None:
        pass

and I have another class extending this dummy base class:

class DendrogramModel(BaseModel):
    def __init__(self, test_dtm: Optional[pd.DataFrame] = None,
                 test_option: Optional[DendroOption] = None) -> None:
        super().__init__()
        self._test_dtm = test_dtm
        self._test_option = test_option

When I type check, mypy gives me the following error:
error: Class cannot subclass 'BaseModel' (has type 'Any')

I don't know why. Is it because I cannot extend the dummy base class?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions