blob: f32490c44ae1d01b17115980cbd368a3f09b278b (
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
|
# pylint: disable=missing-docstring, too-many-ancestors,too-few-public-methods
from typing import Generic, TypeVar
IN = TypeVar('IN', contravariant=True)
OUT = TypeVar('OUT', covariant=True)
class Service:
pass
class ConsumingMixin(Generic[IN]):
pass
class ProducingMixin(Generic[OUT]):
pass
class StreamingMixin(Generic[IN, OUT], ConsumingMixin[IN], ProducingMixin[OUT]):
pass
class Example(StreamingMixin[str, int], Service):
pass
print(Example.__mro__)
|