forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Andrey Maslennikov <[email protected]> Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
- Loading branch information
1 parent
89a22f9
commit 46de19d
Showing
34 changed files
with
1,365 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,3 +68,6 @@ analyze.py | |
|
||
# Mypy cache | ||
.mypy_cache/ | ||
|
||
# pyenv local python version | ||
.python-version |
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,10 @@ | ||
# These names exist in __all__, but have no definition: | ||
boltons.strutils.int_list_complement | ||
boltons.strutils.int_list_to_int_tuples | ||
|
||
# Internal compatibility aliases | ||
boltons.cacheutils.basestring | ||
boltons.funcutils.basestring | ||
boltons.funcutils.inspect_formatargspec | ||
boltons.funcutils.make_method | ||
boltons.iterutils.basestring |
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,4 @@ | ||
version = "23.0.*" | ||
|
||
[tool.stubtest] | ||
ignore_missing_stub = false |
Empty file.
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,115 @@ | ||
import weakref | ||
from _typeshed import Incomplete, Self, SupportsItems, SupportsKeysAndGetItem | ||
from collections.abc import Callable, Generator, Hashable, Iterable, Iterator, Mapping | ||
from typing import Any, Generic, TypeVar, overload | ||
|
||
_KT = TypeVar("_KT") | ||
_VT = TypeVar("_VT") | ||
_T = TypeVar("_T") | ||
|
||
PREV: int | ||
NEXT: int | ||
KEY: int | ||
VALUE: int | ||
DEFAULT_MAX_SIZE: int | ||
|
||
class LRI(dict[_KT, _VT]): | ||
hit_count: int | ||
miss_count: int | ||
soft_miss_count: int | ||
max_size: int | ||
on_miss: Callable[[_KT], _VT] | ||
def __init__(self, max_size: int = 128, values: Incomplete | None = None, on_miss: Incomplete | None = None) -> None: ... | ||
def __setitem__(self, key: _KT, value: _VT) -> None: ... | ||
def __getitem__(self, key: _KT) -> _VT: ... | ||
@overload | ||
def get(self, key: _KT, default: None = None) -> _VT | None: ... | ||
@overload | ||
def get(self, key: _KT, default: _T) -> _T | _VT: ... | ||
def __delitem__(self, key: _KT) -> None: ... | ||
@overload | ||
def pop(self, key: _KT) -> _VT: ... | ||
@overload | ||
def pop(self, key: _KT, default: _T) -> _T | _VT: ... | ||
def popitem(self) -> tuple[_KT, _VT]: ... | ||
def clear(self) -> None: ... | ||
def copy(self: Self) -> Self: ... | ||
@overload | ||
def setdefault(self, key: _KT, default: None = None) -> _VT: ... | ||
@overload | ||
def setdefault(self, key: _KT, default: _VT) -> _VT: ... | ||
def update(self, E: SupportsKeysAndGetItem[_KT, _VT] | Iterable[tuple[_KT, _VT]], **F: _VT) -> None: ... # type: ignore[override] | ||
|
||
class LRU(LRI[_KT, _VT]): | ||
def __getitem__(self, key: _KT) -> _VT: ... | ||
|
||
def make_cache_key( | ||
args: Iterable[Hashable], | ||
kwargs: SupportsItems[Hashable, Hashable], | ||
typed: bool = False, | ||
kwarg_mark: object = ..., | ||
fasttypes: frozenset[type] = ..., | ||
): ... | ||
|
||
class CachedFunction: | ||
func: Incomplete | ||
get_cache: Incomplete | ||
scoped: Incomplete | ||
typed: Incomplete | ||
key_func: Incomplete | ||
def __init__(self, func, cache, scoped: bool = True, typed: bool = False, key: Incomplete | None = None): ... | ||
def __call__(self, *args, **kwargs): ... | ||
|
||
class CachedMethod: | ||
func: Incomplete | ||
get_cache: Incomplete | ||
scoped: Incomplete | ||
typed: Incomplete | ||
key_func: Incomplete | ||
bound_to: Incomplete | ||
def __init__(self, func, cache, scoped: bool = True, typed: bool = False, key: Incomplete | None = None): ... | ||
def __get__(self, obj, objtype: Incomplete | None = None): ... | ||
def __call__(self, *args, **kwargs): ... | ||
|
||
def cached(cache: Mapping[Any, Any], scoped: bool = True, typed: bool = False, key: Incomplete | None = None): ... | ||
def cachedmethod(cache, scoped: bool = True, typed: bool = False, key: Incomplete | None = None): ... | ||
|
||
class cachedproperty(Generic[_T]): | ||
func: Callable[[Incomplete], _T] | ||
def __init__(self, func: Callable[[Incomplete], _T]) -> None: ... | ||
def __get__(self, obj: _T, objtype: type | None = None): ... | ||
|
||
class ThresholdCounter(Generic[_T]): | ||
total: int | ||
def __init__(self, threshold: float = 0.001) -> None: ... | ||
@property | ||
def threshold(self) -> float: ... | ||
def add(self, key: _T) -> None: ... | ||
def elements(self) -> Iterator[_T]: ... | ||
def most_common(self, n: int | None = None) -> list[tuple[_T, int]]: ... | ||
def get_common_count(self) -> int: ... | ||
def get_uncommon_count(self) -> int: ... | ||
def get_commonality(self) -> float: ... | ||
def __getitem__(self, key: _T) -> int: ... | ||
def __len__(self) -> int: ... | ||
def __contains__(self, key: _T) -> bool: ... | ||
def iterkeys(self) -> Iterator[_T]: ... | ||
def keys(self) -> list[_T]: ... | ||
def itervalues(self) -> Generator[int, None, None]: ... | ||
def values(self) -> list[int]: ... | ||
def iteritems(self) -> Generator[tuple[_T, int], None, None]: ... | ||
def items(self) -> list[tuple[_T, int]]: ... | ||
def get(self, key: _T, default: int = 0) -> int: ... | ||
def update(self, iterable: Iterable[_T] | Mapping[_T, int], **kwargs: Iterable[_T] | Mapping[_T, int]) -> None: ... | ||
|
||
class MinIDMap(Generic[_T]): | ||
mapping: weakref.WeakKeyDictionary[_T, int] | ||
ref_map: dict[_T, int] | ||
free: list[int] | ||
def __init__(self) -> None: ... | ||
def get(self, a: _T) -> int: ... | ||
def drop(self, a: _T) -> None: ... | ||
def __contains__(self, a: _T) -> bool: ... | ||
def __iter__(self) -> Iterator[_T]: ... | ||
def __len__(self) -> int: ... | ||
def iteritems(self) -> Iterator[tuple[_T, 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,9 @@ | ||
from _typeshed import Incomplete | ||
from collections.abc import Callable | ||
from typing import Any | ||
|
||
def pdb_on_signal(signalnum: int | None = None) -> None: ... | ||
def pdb_on_exception(limit: int = 100) -> None: ... | ||
def wrap_trace( | ||
obj: Incomplete, hook: Callable[..., Any] = ..., which: str | None = None, events: str | None = None, label: str | None = None | ||
) -> Incomplete: ... |
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 types import ModuleType | ||
from typing import Any | ||
|
||
class DeprecatableModule(ModuleType): | ||
def __init__(self, module: ModuleType) -> None: ... | ||
def __getattribute__(self, name: str) -> Any: ... | ||
|
||
def deprecate_module_member(mod_name: str, name: str, message: str) -> 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,90 @@ | ||
from _typeshed import SupportsKeysAndGetItem | ||
from binascii import Incomplete | ||
from collections.abc import Generator, ItemsView, Iterable, KeysView, ValuesView | ||
from typing import NoReturn, TypeVar | ||
from typing_extensions import Self, TypeAlias | ||
|
||
_KT = TypeVar("_KT") | ||
_VT = TypeVar("_VT") | ||
_T = TypeVar("_T") | ||
|
||
class OrderedMultiDict(dict[_KT, _VT]): | ||
def add(self, k: _KT, v: _VT) -> None: ... | ||
def addlist(self, k: _KT, v: Iterable[_VT]) -> None: ... | ||
def clear(self) -> None: ... | ||
def copy(self) -> Self: ... | ||
def counts(self) -> OrderedMultiDict[_KT, _VT]: ... | ||
@classmethod | ||
def fromkeys(cls, keys: _KT, default: _VT | None = None) -> OrderedMultiDict[_KT, _VT]: ... # type: ignore[override] | ||
def get(self, k: _KT, default: _VT | None = None) -> OrderedMultiDict[_KT, _VT]: ... # type: ignore[override] | ||
def getlist(self, k: _KT, default: _VT | None = ...) -> list[object]: ... | ||
def inverted(self) -> OrderedMultiDict[_KT, _VT]: ... | ||
def items(self, multi: bool = False) -> list[tuple[_KT, _VT]]: ... # type: ignore[override] | ||
def iteritems(self, multi: bool = False) -> Generator[tuple[_KT, _VT], None, None]: ... | ||
def iterkeys(self, multi: bool = False) -> Generator[_KT, None, None]: ... | ||
def itervalues(self, multi: bool = False) -> Generator[_VT, None, None]: ... | ||
def keys(self, multi: bool = False) -> list[_KT]: ... # type: ignore[override] | ||
def pop(self, k: _KT, default: _VT | None = ...) -> _VT: ... # type: ignore[override] | ||
def popall(self, k: _KT, default: _VT | None = ...) -> list[_VT]: ... | ||
def poplast(self, k: _KT | None = ..., default: _VT | None = ...) -> _VT: ... | ||
def setdefault(self, k: _KT, default: _VT | None = ...) -> _VT: ... | ||
def sorted(self, key: _KT | None = None, reverse: bool = False) -> OrderedMultiDict[_KT, _VT]: ... | ||
def sortedvalues(self, key: _KT | None = None, reverse: bool = False) -> OrderedMultiDict[_KT, _VT]: ... | ||
def todict(self, multi: bool = False) -> dict[_KT, _VT]: ... | ||
def update(self, E: dict[_KT, _VT] | Iterable[object], **F) -> None: ... # type: ignore[override] | ||
def update_extend(self, E: dict[_KT, _VT] | Iterable[object], **F) -> None: ... | ||
def values(self, multi: bool = False) -> list[_VT]: ... # type: ignore[override] | ||
def viewitems(self) -> ItemsView[_KT, _VT]: ... | ||
def viewkeys(self) -> KeysView[_KT]: ... | ||
def viewvalues(self) -> ValuesView[_VT]: ... | ||
|
||
OMD: TypeAlias = OrderedMultiDict[_KT, _VT] | ||
MultiDict: TypeAlias = OrderedMultiDict[_KT, _VT] | ||
|
||
class FastIterOrderedMultiDict(OrderedMultiDict[_KT, _VT]): # undocumented | ||
def iteritems(self, multi: bool = False) -> Generator[tuple[_KT, _VT], None, None]: ... | ||
def iterkeys(self, multi: bool = False) -> Generator[_KT, None, None]: ... | ||
|
||
class OneToOne(dict[_KT, _VT]): | ||
inv: dict[_VT, _KT] | ||
def clear(self) -> None: ... | ||
def copy(self) -> Self: ... | ||
def pop(self, key: _KT, default: _VT | _T = ...) -> _VT | _T: ... | ||
def popitem(self) -> tuple[_KT, _VT]: ... | ||
def setdefault(self, key: _KT, default: _VT | None = None) -> _VT: ... | ||
@classmethod | ||
def unique(cls, *a, **kw) -> Self: ... | ||
def update(self, dict_or_iterable, **kw) -> None: ... # type: ignore[override] | ||
|
||
class ManyToMany(dict[_KT, frozenset[_VT]]): | ||
data: dict[_KT, set[_VT]] | ||
inv: dict[_VT, set[_KT]] | ||
# def __contains__(self, key: _KT): ... | ||
def __delitem__(self, key: _KT) -> None: ... | ||
def __eq__(self, other): ... | ||
def __getitem__(self, key: _KT): ... | ||
def __init__(self, items: Iterable[Incomplete] | None = None) -> None: ... | ||
def __iter__(self): ... | ||
def __len__(self): ... | ||
def __setitem__(self, key: _KT, vals: Iterable[_VT]) -> None: ... | ||
def add(self, key: _KT, val: _VT) -> None: ... | ||
def get(self, key: _KT, default: frozenset[_VT] = ...) -> frozenset[_VT]: ... # type: ignore[override] | ||
def iteritems(self) -> Generator[tuple[_KT, _VT], None, None]: ... | ||
def keys(self): ... | ||
def remove(self, key: _KT, val: _VT) -> None: ... | ||
def replace(self, key: _KT, newkey: _KT) -> None: ... | ||
def update(self, iterable: ManyToMany[_KT, _VT] | SupportsKeysAndGetItem[_KT, _VT] | tuple[_KT, _VT]) -> None: ... # type: ignore[override] | ||
|
||
def subdict(d: dict[_KT, _VT], keep: Iterable[_KT] | None = None, drop: Iterable[_KT] | None = None) -> dict[_KT, _VT]: ... | ||
|
||
class FrozenHashError(TypeError): ... # undocumented | ||
|
||
class FrozenDict(dict[_KT, _VT]): | ||
def __copy__(self) -> Self: ... | ||
def clear(self, *a, **kw) -> None: ... | ||
@classmethod | ||
def fromkeys(cls, keys: Iterable[_KT], value: _VT | None = None) -> FrozenDict[_KT, _VT]: ... # type: ignore[override] | ||
def pop(self, *a, **kw) -> NoReturn: ... | ||
def popitem(self, *a, **kw) -> NoReturn: ... | ||
def setdefault(self, *a, **kw) -> NoReturn: ... | ||
def updated(self, *a, **kw) -> Self: ... |
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 NoReturn | ||
|
||
def gobs_program() -> NoReturn: ... |
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,28 @@ | ||
from typing import Any | ||
|
||
ECO_VERSION: str | ||
PY_GT_2: bool | ||
HAVE_URANDOM: bool | ||
INSTANCE_ID: str | ||
IS_64BIT: bool | ||
HAVE_UCS4: bool | ||
HAVE_READLINE: bool | ||
SQLITE_VERSION: str | ||
OPENSSL_VERSION: str | ||
TKINTER_VERSION: str | ||
ZLIB_VERSION: str | ||
EXPAT_VERSION: str | ||
CPU_COUNT: int | ||
HAVE_THREADING: bool | ||
HAVE_IPV6: bool | ||
RLIMIT_NOFILE: int | ||
RLIMIT_FDS_SOFT: int | ||
RLIMIT_FDS_HARD: int | ||
START_TIME_INFO: dict[str, str | float] | ||
|
||
def getrandbits(k: int) -> int: ... | ||
def get_python_info() -> dict[str, Any]: ... | ||
def get_profile(**kwargs) -> dict[str, Any]: ... | ||
def get_profile_json(indent: bool = False) -> str: ... | ||
def main() -> None: ... | ||
def dumps(val: Any, indent: int) -> str: ... |
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,9 @@ | ||
from typing import Any | ||
from typing_extensions import Self | ||
|
||
class ExceptionCauseMixin(Exception): | ||
cause: Any | ||
def __new__(cls, *args, **kw) -> Self: ... | ||
def get_str(self) -> str: ... | ||
|
||
class MathError(ExceptionCauseMixin, ValueError): ... |
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,79 @@ | ||
from _typeshed import StrOrBytesPath | ||
from collections.abc import Callable, Generator, Iterable | ||
from types import TracebackType | ||
from typing import IO, Any, NoReturn | ||
from typing_extensions import Self | ||
|
||
def mkdir_p(path: StrOrBytesPath) -> None: ... | ||
|
||
class FilePerms: | ||
user: str | ||
group: str | ||
other: str | ||
def __init__(self, user: str = "", group: str = "", other: str = "") -> None: ... | ||
@classmethod | ||
def from_int(cls, i: int) -> Self: ... | ||
@classmethod | ||
def from_path(cls, path: StrOrBytesPath) -> Self: ... | ||
def __int__(self) -> int: ... | ||
|
||
def atomic_save(dest_path: str, **kwargs) -> AtomicSaver: ... | ||
|
||
class AtomicSaver: | ||
dest_path: str | ||
overwrite: bool | ||
file_perms: int | ||
overwrite_part: bool | ||
part_filename: str | ||
rm_part_on_exc: bool | ||
text_mode: bool | ||
buffering: int | ||
dest_dir: str | ||
part_path: str | ||
mode: str | ||
open_flags: int | ||
part_file: str | None | ||
def __init__(self, dest_path: str, **kwargs) -> None: ... | ||
def setup(self) -> None: ... | ||
def __enter__(self) -> IO[Any] | None: ... | ||
def __exit__( | ||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None | ||
) -> None: ... | ||
|
||
def iter_find_files( | ||
directory: str, patterns: str | Iterable[str], ignored: str | Iterable[str] | None = None, include_dirs: bool = False | ||
) -> Generator[str, None, None]: ... | ||
def copy_tree( | ||
src: StrOrBytesPath, | ||
dst: StrOrBytesPath, | ||
symlinks: bool = False, | ||
ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrOrBytesPath, list[str]], Iterable[str]] = None, | ||
) -> None: ... | ||
|
||
copytree = copy_tree | ||
|
||
class DummyFile: | ||
name: str | ||
mode: str | ||
closed: bool | ||
errors: None | ||
isatty: bool | ||
encoding: None | ||
newlines: None | ||
softspace: int | ||
def __init__(self, path: StrOrBytesPath, mode: str = "r", buffering: int | None = None) -> None: ... | ||
def close(self) -> None: ... | ||
def fileno(self) -> int: ... | ||
def flush(self) -> None: ... | ||
def next(self) -> NoReturn: ... | ||
def read(self, size: int = 0) -> str: ... | ||
def readline(self, size: int = 0) -> str: ... | ||
def readlines(self, size: int = 0) -> list[str]: ... | ||
def seek(self) -> None: ... | ||
def tell(self) -> int: ... | ||
def truncate(self) -> None: ... | ||
def write(self, string: str) -> None: ... | ||
def writelines(self, list_of_strings: list[str]) -> None: ... | ||
def __next__(self) -> NoReturn: ... | ||
def __enter__(self) -> None: ... | ||
def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... |
Oops, something went wrong.