Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mgerhold opened this issue Oct 23, 2023 · 0 comments
Open

Comments

@mgerhold
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant