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

Add regression test for no-member with generic base class #4471

Merged
merged 1 commit into from
May 30, 2021
Merged

Add regression test for no-member with generic base class #4471

merged 1 commit into from
May 30, 2021

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented May 12, 2021

Description

Add regression test. This is fixed with the current astroid master branch.

from abc import ABC
from typing import Generic, TypeVar

Anything = TypeVar("Anything")
MoreSpecific = TypeVar("MoreSpecific", str, int)

class A(ABC, Generic[Anything]):
    def a_method(self) -> None:
        print("hello")

class B(A[MoreSpecific]):
    pass

class C(B[str]):
    pass

c = C()
c.a_method()  # should NOT emit no-member error

Type of Changes

Type
🐛 Bug fix

Related Issue

Closes pylint-dev/astroid#942

@cdce8p cdce8p added Bug 🪲 Needs astroid update Needs an astroid update (probably a release too) before being mergable labels May 12, 2021
@cdce8p cdce8p added this to the 2.8.3 milestone May 24, 2021
@Pierre-Sassoulas
Copy link
Member

This can be rebased on master to get astroid 2.5.7.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.832% when pulling ce0d0bd on cdce8p:regression-test-generic-base into 0e51660 on PyCQA:master.

@cdce8p cdce8p merged commit 6dec95b into pylint-dev:master May 30, 2021
@cdce8p cdce8p deleted the regression-test-generic-base branch May 30, 2021 00:23
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.8.3, 2.9.0 May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Needs astroid update Needs an astroid update (probably a release too) before being mergable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

member lookup with Generic base class in 2.5.3
3 participants