summaryrefslogtreecommitdiff
path: root/tests/functional/a/assigning/assigning_non_slot_4509.py
blob: 797c6b083ec628f4fc70fc0b75a5a89b10d7d62a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# pylint: disable=invalid-name,missing-docstring,too-few-public-methods

# Slots with base that inherits from 'Generic'
# https://github.com/PyCQA/pylint/issues/4509
# https://github.com/PyCQA/astroid/issues/999

from typing import Generic, TypeVar
T = TypeVar("T")

class Base(Generic[T]):
    __slots__ = ()

class Foo(Base[T]):
    __slots__ = ['_value']

    def __init__(self, value: T):
        self._value = value
        self._bar = value  # [assigning-non-slot]