blob: bb1cde6de19afafe02079ce3b8d6f458ba6a0119 (
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/pylint-dev/pylint/issues/4509
# https://github.com/pylint-dev/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]
|