mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
make sure typevars defined in stubs are private (#989)
And also a few type aliases I noticed in the process.
Found using 59f9cac095
This commit is contained in:
committed by
Guido van Rossum
parent
984307bf45
commit
eb07fd3c1a
@@ -815,12 +815,12 @@ class ellipsis: ...
|
||||
Ellipsis = ... # type: ellipsis
|
||||
|
||||
# TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check.
|
||||
AnyBuffer = TypeVar('AnyBuffer', str, unicode, bytearray, buffer)
|
||||
_AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer)
|
||||
|
||||
class buffer(Sized):
|
||||
def __init__(self, object: AnyBuffer, offset: int = ..., size: int = ...) -> None: ...
|
||||
def __add__(self, other: AnyBuffer) -> str: ...
|
||||
def __cmp__(self, other: AnyBuffer) -> bool: ...
|
||||
def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ...
|
||||
def __add__(self, other: _AnyBuffer) -> str: ...
|
||||
def __cmp__(self, other: _AnyBuffer) -> bool: ...
|
||||
def __getitem__(self, key: Union[int, slice]) -> str: ...
|
||||
def __getslice__(self, i: int, j: int) -> str: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
from typing import (Any, Generic, IO, Iterable, Sequence, TypeVar,
|
||||
Union, overload, Iterator, Tuple, BinaryIO, List)
|
||||
|
||||
T = TypeVar('T')
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class array(Generic[T]):
|
||||
def __init__(self, typecode: str, init: Iterable[T] = ...) -> None: ...
|
||||
def __add__(self, y: "array[T]") -> "array[T]": ...
|
||||
class array(Generic[_T]):
|
||||
def __init__(self, typecode: str, init: Iterable[_T] = ...) -> None: ...
|
||||
def __add__(self, y: "array[_T]") -> "array[_T]": ...
|
||||
def __contains__(self, y: Any) -> bool: ...
|
||||
def __copy__(self) -> "array[T]": ...
|
||||
def __copy__(self) -> "array[_T]": ...
|
||||
def __deepcopy__(self) -> "array": ...
|
||||
def __delitem__(self, y: Union[slice, int]) -> None: ...
|
||||
def __delslice__(self, i: int, j: int) -> None: ...
|
||||
@@ -17,39 +17,39 @@ class array(Generic[T]):
|
||||
def __getitem__(self, i: int) -> Any: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> "array": ...
|
||||
def __iadd__(self, y: "array[T]") -> "array[T]": ...
|
||||
def __imul__(self, y: int) -> "array[T]": ...
|
||||
def __iter__(self) -> Iterator[T]: ...
|
||||
def __iadd__(self, y: "array[_T]") -> "array[_T]": ...
|
||||
def __imul__(self, y: int) -> "array[_T]": ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __mul__(self, n: int) -> "array[T]": ...
|
||||
def __rmul__(self, n: int) -> "array[T]": ...
|
||||
def __mul__(self, n: int) -> "array[_T]": ...
|
||||
def __rmul__(self, n: int) -> "array[_T]": ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, y: T) -> None: ...
|
||||
def __setitem__(self, i: int, y: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, i: slice, y: "array[T]") -> None: ...
|
||||
def __setitem__(self, i: slice, y: "array[_T]") -> None: ...
|
||||
|
||||
def append(self, x: T) -> None: ...
|
||||
def append(self, x: _T) -> None: ...
|
||||
def buffer_info(self) -> Tuple[int, int]: ...
|
||||
def byteswap(self) -> None:
|
||||
raise RuntimeError()
|
||||
def count(self) -> int: ...
|
||||
def extend(self, x: Sequence[T]) -> None: ...
|
||||
def fromlist(self, list: List[T]) -> None:
|
||||
def extend(self, x: Sequence[_T]) -> None: ...
|
||||
def fromlist(self, list: List[_T]) -> None:
|
||||
raise EOFError()
|
||||
raise IOError()
|
||||
def fromfile(self, f: BinaryIO, n: int) -> None: ...
|
||||
def fromstring(self, s: str) -> None: ...
|
||||
def fromunicode(self, u: unicode) -> None: ...
|
||||
def index(self, x: T) -> int: ...
|
||||
def insert(self, i: int, x: T) -> None: ...
|
||||
def pop(self, i: int = ...) -> T: ...
|
||||
def index(self, x: _T) -> int: ...
|
||||
def insert(self, i: int, x: _T) -> None: ...
|
||||
def pop(self, i: int = ...) -> _T: ...
|
||||
def read(self, f: IO[str], n: int) -> None:
|
||||
raise DeprecationWarning()
|
||||
def remove(self, x: T) -> None: ...
|
||||
def remove(self, x: _T) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def tofile(self, f: BinaryIO) -> None:
|
||||
raise IOError()
|
||||
def tolist(self) -> List[T]: ...
|
||||
def tolist(self) -> List[_T]: ...
|
||||
def tostring(self) -> str: ...
|
||||
def tounicode(self) -> unicode: ...
|
||||
def write(self, f: IO[str]) -> None:
|
||||
|
||||
Reference in New Issue
Block a user