blob: 4b2985e0dcdeb513ac3a7237f5f35c383ec0d039 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods
# https://github.com/PyCQA/pylint/issues/2822
# Base should be subscriptable, even with ABCMeta as metaclass
from abc import ABC, ABCMeta
from typing import Generic, TypeVar
T = TypeVar("T")
class Base(Generic[T], metaclass=ABCMeta):
"""Base"""
class Impl(Base[str]):
"""Impl"""
# https://github.com/PyCQA/astroid/issues/942
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
|