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

False positive: arguments-differ for __init_subclass__ in generic #8919

Closed
ShadowLNC opened this issue Aug 3, 2023 · 1 comment · Fixed by #8927 or #9093
Closed

False positive: arguments-differ for __init_subclass__ in generic #8919

ShadowLNC opened this issue Aug 3, 2023 · 1 comment · Fixed by #8927 or #9093
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@ShadowLNC
Copy link

Bug description

from typing import Generic, TypeVar


T = TypeVar("T")


class Testing(Generic[T]):  # pylint: disable=too-few-public-methods
    """Placeholder."""

    def __init_subclass__(cls, /, **kwargs: Any) -> None:
        """Placeholder."""
        super().__init_subclass__(**kwargs)

Configuration

No response

Command used

pylint file.py

Pylint output

************* Module file
file.py:10:4: W0221: Variadics removed in overriding 'Testing.__init_subclass__' method (arguments-differ)

------------------------------------------------------------------
Your code has been rated at 9.88/10 (previous run: 9.88/10, +0.00)

Expected behavior

I believe this is a false positive.

When I don't inherit from Generic[T], the error goes away.

Pylint version

pylint 2.17.5
astroid 2.15.6
Python 3.11.1 (v3.11.1:a7a450f84a, Dec  6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)]

OS / Environment

MacOS Ventura 13.5

Additional dependencies

No response

@ShadowLNC ShadowLNC added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Aug 3, 2023
@mbyrnepr2 mbyrnepr2 added Needs PR This issue is accepted, sufficiently specified and now needs an implementation False Positive 🦟 A message is emitted but nothing is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 3, 2023
@mbyrnepr2
Copy link
Member

Thanks!

mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Aug 5, 2023
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Aug 5, 2023
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Aug 5, 2023
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Aug 5, 2023
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Aug 7, 2023
@mbyrnepr2 mbyrnepr2 added this to the 2.17.6 milestone Aug 7, 2023
mbyrnepr2 added a commit that referenced this issue Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
2 participants