from collections.abc import Callable as Callable, Iterable, Iterator, MutableSequence
from typing import Any, TypeVar, overload

T = TypeVar('T')
Self = TypeVar('Self', bound='ConstrainedList')

class ConstrainedList(MutableSequence[T]):
    def __init__(self, iterable: Iterable[T] | None = None) -> None: ...
    def append(self, item: T) -> None: ...
    def __delitem__(self, index: slice | int) -> None: ...
    def extend(self, val: Iterable[T]) -> None: ...
    def __eq__(self, other: Any) -> Any: ...
    @overload
    def __getitem__(self, index: int) -> T: ...
    @overload
    def __getitem__(self, index: slice) -> MutableSequence[T]: ...
    def __iadd__(self, other: Iterable[T]) -> Self: ...
    def insert(self, position: int, item: T) -> None: ...
    def __iter__(self) -> Iterator[T]: ...
    def __len__(self) -> int: ...
    def __ne__(self, other: Any) -> Any: ...
    @overload
    def __setitem__(self, idx: int, val: T) -> None: ...
    @overload
    def __setitem__(self, idx: slice, val: Iterable[T]) -> None: ...

class MultiValue(ConstrainedList[T]):
    def __init__(self, type_constructor: Callable[[Any], T], iterable: Iterable[Any]) -> None: ...
    def sort(self, *args: Any, **kwargs: Any) -> None: ...
