Use _typeshed.Self in Python 2, too (#6932)

This commit is contained in:
Alex Waygood
2022-01-16 22:44:51 +00:00
committed by GitHub
parent 0949e9e90d
commit 6a88d5e7ae
29 changed files with 156 additions and 160 deletions

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import Self
from abc import ABCMeta
from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union
@@ -59,15 +60,15 @@ class Flag(Enum):
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __bool__(self) -> bool: ...
def __or__(self: _T, other: _T) -> _T: ...
def __and__(self: _T, other: _T) -> _T: ...
def __xor__(self: _T, other: _T) -> _T: ...
def __invert__(self: _T) -> _T: ...
def __or__(self: Self, other: Self) -> Self: ...
def __and__(self: Self, other: Self) -> Self: ...
def __xor__(self: Self, other: Self) -> Self: ...
def __invert__(self: Self) -> Self: ...
class IntFlag(int, Flag):
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
def __and__(self: _T, other: Union[int, _T]) -> _T: ...
def __xor__(self: _T, other: Union[int, _T]) -> _T: ...
def __or__(self: Self, other: Union[int, Self]) -> Self: ...
def __and__(self: Self, other: Union[int, Self]) -> Self: ...
def __xor__(self: Self, other: Union[int, Self]) -> Self: ...
__ror__ = __or__
__rand__ = __and__
__rxor__ = __xor__