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,3 +1,4 @@
from _typeshed import Self
from typing import Any, Container, Generic, Iterable, Iterator, Optional, SupportsInt, Text, Tuple, TypeVar, overload
# Undocumented length constants
@@ -30,10 +31,10 @@ class _IPAddressBase:
class _BaseAddress(_IPAddressBase, SupportsInt):
def __init__(self, address: object) -> None: ...
def __add__(self: _T, other: int) -> _T: ...
def __add__(self: Self, other: int) -> Self: ...
def __hash__(self) -> int: ...
def __int__(self) -> int: ...
def __sub__(self: _T, other: int) -> _T: ...
def __sub__(self: Self, other: int) -> Self: ...
@property
def is_global(self) -> bool: ...
@property
@@ -87,7 +88,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
@property
def prefixlen(self) -> int: ...
def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ...
def supernet(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> _T: ...
def supernet(self: Self, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Self: ...
@property
def with_hostmask(self) -> Text: ...
@property