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,7 +1,7 @@
# True and False are deliberately omitted because they are keywords in
# Python 3, and stub files conform to Python 3 syntax.
from _typeshed import ReadableBuffer, SupportsKeysAndGetItem, SupportsWrite
from _typeshed import ReadableBuffer, Self, SupportsKeysAndGetItem, SupportsWrite
from abc import ABCMeta
from ast import mod
from types import CodeType
@@ -651,7 +651,7 @@ class list(MutableSequence[_T], Generic[_T]):
def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ...
def __delslice__(self, start: int, stop: int) -> None: ...
def __add__(self, x: List[_T]) -> List[_T]: ...
def __iadd__(self: _S, x: Iterable[_T]) -> _S: ...
def __iadd__(self: Self, x: Iterable[_T]) -> Self: ...
def __mul__(self, n: int) -> List[_T]: ...
def __rmul__(self, n: int) -> List[_T]: ...
def __contains__(self, o: object) -> bool: ...