summaryrefslogtreecommitdiff
path: root/puzzles/50_typevar_constrained.py
blob: 50ce10a146396b9e8428bd59b18d78987ab0bea8 (plain)
1
2
3
4
5
6
7
8
9
from typing import TypeVar, Any, Union

V = TypeVar("V", str, bytes)

def check_v(x: Union[V, list[V]]) -> V:
    raise NotImplementedError()

def foo(a: list[Any]):
    check_v(a)