mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
# Based on http://docs.python.org/3.6/library/array.html
|
||||
|
||||
import sys
|
||||
from typing import (Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence,
|
||||
overload, Text, Tuple, TypeVar, Union)
|
||||
from typing import Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
|
||||
|
||||
from typing_extensions import Literal
|
||||
|
||||
_IntTypeCode = Literal['b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q']
|
||||
_FloatTypeCode = Literal['f', 'd']
|
||||
_UnicodeTypeCode = Literal['u']
|
||||
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
|
||||
_FloatTypeCode = Literal["f", "d"]
|
||||
_UnicodeTypeCode = Literal["u"]
|
||||
_TypeCode = Union[_IntTypeCode, _FloatTypeCode, _UnicodeTypeCode]
|
||||
|
||||
_T = TypeVar('_T', int, float, Text)
|
||||
_T = TypeVar("_T", int, float, Text)
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
typecodes: str
|
||||
@@ -21,17 +21,13 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
typecode: _TypeCode
|
||||
itemsize: int
|
||||
@overload
|
||||
def __init__(self: array[int], typecode: _IntTypeCode,
|
||||
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
def __init__(self: array[int], typecode: _IntTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self: array[float], typecode: _FloatTypeCode,
|
||||
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
def __init__(self: array[float], typecode: _FloatTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self: array[Text], typecode: _UnicodeTypeCode,
|
||||
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
def __init__(self: array[Text], typecode: _UnicodeTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, typecode: str,
|
||||
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
def __init__(self, typecode: str, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
|
||||
def append(self, __v: _T) -> None: ...
|
||||
def buffer_info(self) -> Tuple[int, int]: ...
|
||||
def byteswap(self) -> None: ...
|
||||
@@ -59,19 +55,15 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
if sys.version_info < (3, 9):
|
||||
def fromstring(self, __buffer: bytes) -> None: ...
|
||||
def tostring(self) -> bytes: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> array[_T]: ...
|
||||
|
||||
@overload # type: ignore # Overrides MutableSequence
|
||||
def __setitem__(self, i: int, o: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, o: array[_T]) -> None: ...
|
||||
|
||||
def __delitem__(self, i: Union[int, slice]) -> None: ...
|
||||
def __add__(self, x: array[_T]) -> array[_T]: ...
|
||||
def __ge__(self, other: array[_T]) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user