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

ignore typing.Generic in E0241: duplicate bases #2717

Closed
cedroyer opened this issue Jan 30, 2019 · 3 comments · Fixed by pylint-dev/astroid#916 or PennyDreadfulMTG/Penny-Dreadful-Tools#8447

Comments

@cedroyer
Copy link

cedroyer commented Jan 30, 2019

Is your feature request related to a problem? Please describe

When I use typing.Generic in 2 levels of inheritance (I think it's a correct way to use Generic), I don't want to have a E0241: duplicate bases message.

Describe the solution you'd like

Ignore typing.Generic for E0241: duplicate bases duplicate test.

Additional context

Add any other context about the feature request here.

short exemple:

from typing import Generic, TypeVar

Number = TypeVar("Number")

class IVector(Generic[Number]):
      pass

class SparceVector(Generic[Number], IVector[Number]):
     pass

 # get `E0241: duplicate bases`.
class IntVector(SparceVector[int]):
    pass
@PCManticore
Copy link
Contributor

Hi, thanks for the report. I cannot reproduce your problem, what pylint and astroid versions are you using? On what Python version? The only issue I'm getting is Value 'TypeVar' is unsubscriptable (unsubscriptable-object) which makes sense given that we don't have support for TypeVars.

@PCManticore PCManticore added Bug 🪲 Needs reproduction 🔍 Need a way to reproduce it locally on a maintainer's machine labels Jan 30, 2019
@cedroyer
Copy link
Author

Hi, thank you for your answer. Sorry for the mistake with TypeVar, I corrected it.

here is my pylint version:

% pylint --version
pylint 2.2.2
astroid 2.1.0
Python 3.7.2 (default, Jan 10 2019, 23:51:51) 
[GCC 8.2.1 20181127]

and the disable part of my .pylintrc:

[MESSAGES CONTROL]
disable=bad-continuation,
        too-many-ancestors,
        unsubscriptable-object,
        ungrouped-imports,
        wrong-import-order, 
        missing-docstring

@PCManticore PCManticore added typing and removed Needs reproduction 🔍 Need a way to reproduce it locally on a maintainer's machine labels Jan 31, 2019
@PCManticore
Copy link
Contributor

Thanks @cedroyer I can reproduce it now.

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