-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source commit: python/typeshed@c4da375 Co-authored-by: hauntsaninja <>
- Loading branch information
1 parent
9f6b373
commit 7f92107
Showing
414 changed files
with
16,778 additions
and
4,697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from collections import deque | ||
from typing import Any, Deque, Generic, Optional, TypeVar | ||
|
||
_T = TypeVar("_T") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import sys | ||
from typing import List | ||
|
||
class _Feature: | ||
def __init__(self, optionalRelease: sys._version_info, mandatoryRelease: sys._version_info, compiler_flag: int) -> None: ... | ||
def getOptionalRelease(self) -> sys._version_info: ... | ||
def getMandatoryRelease(self) -> sys._version_info: ... | ||
compiler_flag: int | ||
|
||
absolute_import: _Feature | ||
division: _Feature | ||
generators: _Feature | ||
nested_scopes: _Feature | ||
print_function: _Feature | ||
unicode_literals: _Feature | ||
with_statement: _Feature | ||
all_feature_names: List[str] # undocumented |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from typing import Any | ||
|
||
def __getattr__(name: str) -> Any: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from typing import MutableSequence, Optional, Sequence, TypeVar | ||
|
||
_T = TypeVar("_T") | ||
|
||
def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ... | ||
def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ... | ||
def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> None: ... | ||
def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import codecs | ||
import sys | ||
from typing import Any, Callable, Dict, Optional, Text, Tuple, Union | ||
|
||
# For convenience: | ||
_Handler = Callable[[Exception], Tuple[Text, int]] | ||
_String = Union[bytes, str] | ||
_Errors = Union[str, Text, None] | ||
_Decodable = Union[bytes, Text] | ||
_Encodable = Union[bytes, Text] | ||
|
||
# This type is not exposed; it is defined in unicodeobject.c | ||
class _EncodingMap(object): | ||
def size(self) -> int: ... | ||
|
||
_MapT = Union[Dict[int, int], _EncodingMap] | ||
|
||
def register(__search_function: Callable[[str], Any]) -> None: ... | ||
def register_error(__errors: Union[str, Text], __handler: _Handler) -> None: ... | ||
def lookup(__encoding: Union[str, Text]) -> codecs.CodecInfo: ... | ||
def lookup_error(__name: Union[str, Text]) -> _Handler: ... | ||
def decode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... | ||
def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... | ||
def charmap_build(__map: Text) -> _MapT: ... | ||
def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... | ||
def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... | ||
def charmap_encode(__str: _Encodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... | ||
def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ... | ||
def escape_encode(__data: bytes, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def latin_1_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ... | ||
def latin_1_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def raw_unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... | ||
def raw_unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def readbuffer_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... | ||
def unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def unicode_internal_decode(__obj: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ... | ||
def unicode_internal_encode(__obj: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_16_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_16_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... | ||
def utf_16_ex_decode( | ||
__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ... | ||
) -> Tuple[Text, int, int]: ... | ||
def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_16_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_32_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_32_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ... | ||
def utf_32_ex_decode( | ||
__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ... | ||
) -> Tuple[Text, int, int]: ... | ||
def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_32_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_7_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
def utf_8_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def utf_8_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... | ||
|
||
if sys.platform == "win32": | ||
def mbcs_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ... | ||
def mbcs_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from typing import Any, Iterable, Iterator, List, Optional, Protocol, Sequence, Text, Type, Union | ||
|
||
QUOTE_ALL: int | ||
QUOTE_MINIMAL: int | ||
QUOTE_NONE: int | ||
QUOTE_NONNUMERIC: int | ||
|
||
class Error(Exception): ... | ||
|
||
class Dialect: | ||
delimiter: str | ||
quotechar: Optional[str] | ||
escapechar: Optional[str] | ||
doublequote: bool | ||
skipinitialspace: bool | ||
lineterminator: str | ||
quoting: int | ||
strict: int | ||
def __init__(self) -> None: ... | ||
|
||
_DialectLike = Union[str, Dialect, Type[Dialect]] | ||
|
||
class _reader(Iterator[List[str]]): | ||
dialect: Dialect | ||
line_num: int | ||
def next(self) -> List[str]: ... | ||
|
||
class _writer: | ||
dialect: Dialect | ||
def writerow(self, row: Sequence[Any]) -> Any: ... | ||
def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ... | ||
|
||
class _Writer(Protocol): | ||
def write(self, s: str) -> Any: ... | ||
|
||
def writer(csvfile: _Writer, dialect: _DialectLike = ..., **fmtparams: Any) -> _writer: ... | ||
def reader(csvfile: Iterable[Text], dialect: _DialectLike = ..., **fmtparams: Any) -> _reader: ... | ||
def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ... | ||
def unregister_dialect(name: str) -> None: ... | ||
def get_dialect(name: str) -> Dialect: ... | ||
def list_dialects() -> List[str]: ... | ||
def field_size_limit(new_limit: int = ...) -> int: ... |
Oops, something went wrong.