from typing import Iterator, Any, Iterable, MutableSet, TypeVar, Generic

_T = TypeVar('_T')

class WeakSet(MutableSet[_T], Generic[_T]):
    def __init__(self, data: Iterable[_T] = ...) -> None: ...

    def add(self, x: _T) -> None: ...
    def discard(self, x: _T) -> None: ...
    def __contains__(self, x: Any) -> bool: ...
    def __len__(self) -> int: ...
    def __iter__(self) -> Iterator[_T]: ...

    # TODO: difference, difference_update, ...
