Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Generic, Iterable, Iterator, MutableSet, Optional, TypeVar, Union
from typing import Any, Generic, Iterable, Iterator, MutableSet, TypeVar
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -9,7 +9,7 @@ _T = TypeVar("_T")
_SelfT = TypeVar("_SelfT", bound=WeakSet[Any])
class WeakSet(MutableSet[_T], Generic[_T]):
def __init__(self, data: Optional[Iterable[_T]] = ...) -> None: ...
def __init__(self, data: Iterable[_T] | None = ...) -> None: ...
def add(self, item: _T) -> None: ...
def clear(self) -> None: ...
def discard(self, item: _T) -> None: ...
@@ -20,7 +20,7 @@ class WeakSet(MutableSet[_T], Generic[_T]):
def __contains__(self, item: object) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
def __ior__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
def __ior__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def difference(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
def __sub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
def difference_update(self, other: Iterable[_T]) -> None: ...
@@ -36,12 +36,12 @@ class WeakSet(MutableSet[_T], Generic[_T]):
def __ge__(self, other: Iterable[_T]) -> bool: ...
def __gt__(self, other: Iterable[_T]) -> bool: ...
def __eq__(self, other: object) -> bool: ...
def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
def __xor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def __xor__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def symmetric_difference_update(self, other: Iterable[Any]) -> None: ...
def __ixor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
def union(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
def __or__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
def __ixor__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def union(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def __or__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
def isdisjoint(self, other: Iterable[_T]) -> bool: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...