Skip to content

pylama reports false-positives from mypy that mypy itself doesn't report #246

Description

@mgerhold

I created a new virtual environment using Python 3.11 and installed pylama via pip like so:

pip install pylama[all]

I created the following directory structure:

.
|-- pylama_test
  |-- __ini__.py (empty file)
  |-- parent.py
  |-- child.py

Contents of ./pylama_test/parent.py:

class Parent:
    def my_func(self) -> str:
        return "parent"

Contents of ./pylama/child.py:

from typing_extensions import override

from pylama_test.parent import Parent


class Child(Parent):
    @override
    def my_func(self) -> str:
        return "child"

Current Behavior:

When running mypy:

$ python -m mypy pylama_test/
Success: no issues found in 3 source files

But when running mypy through pylama:

$ python -m pylama --linters mypy pylama_test/
pylama_test\child.py:8:5  Method "my_func" is marked as an override, but no base method was found with this name  [misc] [mypy]

Expected Behavior:
The output of pylama should match the output of mypy.

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