-
Notifications
You must be signed in to change notification settings - Fork 383
types boltons/dictutils.py #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
blablatdinov
wants to merge
3
commits into
mahmoud:master
Choose a base branch
from
blablatdinov:dictutils-types
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,118 @@ | ||
| try: | ||
| from collections.abc import ItemsView, KeysView, ValuesView | ||
| except ImportError: | ||
| from collections import KeysView, ValuesView, ItemsView | ||
|
|
||
| from collections.abc import Callable, Generator, Hashable, Iterable, Iterator | ||
| from typing import Any, Never | ||
|
|
||
| class OrderedMultiDict(dict): | ||
| def __init__(self, *args, **kwargs) -> None: ... | ||
| def add(self, k: Hashable, v: Any) -> None: ... | ||
| def addlist(self, k: Hashable, v: Any) -> None: ... | ||
| def get(self, k: Hashable, default: Any | None = ...) -> Any: ... | ||
| def getlist(self, k: Hashable, default=...) -> list[Any]: ... | ||
| def clear(self) -> None: ... | ||
| def setdefault(self, k: Hashable, default: Any = ...) -> Any: ... | ||
| def copy(self) -> OrderedMultiDict: ... | ||
| @classmethod | ||
| def fromkeys( | ||
| cls, keys: list[Any], default: Any | None = ... | ||
| ) -> OrderedMultiDict: ... | ||
| def update(self, E: dict[Any, Any] | Iterable, **F: dict[str, Any]) -> None: ... | ||
| def update_extend( | ||
| self, E: dict[Any, Any] | Iterable, **F: dict[str, Any] | ||
| ) -> None: ... | ||
| def __setitem__(self, k: Hashable, v: Any) -> None: ... | ||
| def __getitem__(self, k: Hashable) -> Any: ... | ||
| def __delitem__(self, k: Hashable) -> None: ... | ||
| def __eq__(self, other: OrderedMultiDict) -> bool: ... | ||
| def __ne__(self, other: OrderedMultiDict) -> bool: ... | ||
| def pop(self, k: Hashable, default: Any = ...) -> None: ... | ||
| def popall(self, k: Hashable, default: Any = ...) -> None: ... | ||
| def poplast(self, k: Hashable = ..., default: Any = ...) -> None: ... | ||
| def iteritems(self, multi: bool = ...) -> Generator[Any, None, None]: ... | ||
| def iterkeys(self, multi: bool = ...) -> Generator[Any, None, None]: ... | ||
| def itervalues(self, multi: bool = ...) -> Generator[Any, None, None]: ... | ||
| def todict(self, multi: bool = ...) -> dict[Hashable, Any]: ... | ||
| def sorted( | ||
| self, key: Any | None = ..., reverse: bool = ... | ||
| ) -> OrderedMultiDict: ... | ||
| def sortedvalues( | ||
| self, key: Any | None = ..., reverse: bool = ... | ||
| ) -> OrderedMultiDict: ... | ||
| def inverted(self) -> OrderedMultiDict: ... | ||
| def counts(self) -> OrderedMultiDict: ... | ||
| def keys(self, multi: bool = ...) -> list[Hashable]: ... | ||
| def values(self, multi: bool = ...) -> list[Any]: ... | ||
| def items(self, multi: bool = ...) -> list[Generator[Any, None, None]]: ... | ||
| def __iter__(self) -> Generator[Any, None, None]: ... | ||
| def __reversed__(self) -> Generator[Any, None, None]: ... | ||
| def viewkeys(self) -> KeysView: ... | ||
| def viewvalues(self) -> ValuesView: ... | ||
| def viewitems(self) -> ItemsView: ... | ||
|
|
||
| OMD = OrderedMultiDict | ||
mahmoud marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| MultiDict = OrderedMultiDict | ||
|
|
||
| class FastIterOrderedMultiDict(OrderedMultiDict): | ||
| def iteritems(self, multi: bool = ...) -> Generator[Any, None, None]: ... | ||
| def iterkeys(self, multi: bool = ...) -> Generator[Any, None, None]: ... | ||
| def __reversed__(self) -> Generator[Any, None, None]: ... | ||
|
|
||
| class OneToOne(dict): | ||
| inv: OneToOne | ||
| def __init__(self, *a, **kw) -> None: ... | ||
| @classmethod | ||
| def unique(cls, *a, **kw): ... | ||
| def __setitem__(self, key: Hashable, val: Hashable) -> None: ... | ||
| def __delitem__(self, key: Hashable) -> None: ... | ||
| def clear(self) -> None: ... | ||
| def copy(self) -> OneToOne: ... | ||
| def pop(self, key: Hashable, default: Any = ...) -> Hashable: ... | ||
| def popitem(self) -> tuple[Hashable, Hashable]: ... | ||
| def setdefault(self, key, default: Any = ...) -> Hashable: ... | ||
| def update( | ||
| self, dict_or_iterable: dict | Iterable, **kw: dict[Hashable, Any] | ||
| ) -> None: ... | ||
|
|
||
| class ManyToMany: | ||
| data: dict[Hashable, Any] | ||
| inv: ManyToMany | ||
| def __init__(self, items: tuple[Hashable] | dict[Hashable, Any] = ...) -> None: ... | ||
| def get(self, key: Hashable, default: Any = ...) -> Any: ... | ||
| def __getitem__(self, key: Hashable) -> Any: ... | ||
| def __setitem__(self, key: Hashable, vals: Iterable) -> None: ... | ||
| def __delitem__(self, key: Hashable) -> None: ... | ||
| def update(self, iterable: Iterable) -> None: ... | ||
| def add(self, key: Hashable, val: Any) -> None: ... | ||
| def remove(self, key: Hashable, val: Any) -> None: ... | ||
| def replace(self, key: Hashable, newkey: Hashable) -> None: ... | ||
| def iteritems(self) -> Generator[Hashable, Any]: ... | ||
| def keys(self) -> Iterable[Hashable]: ... | ||
| def __contains__(self, key: Hashable) -> bool: ... | ||
| def __iter__(self) -> Iterator: ... | ||
| def __len__(self) -> int: ... | ||
| def __eq__(self, other) -> bool: ... | ||
|
|
||
| def subdict( | ||
| d, keep: dict[Hashable, Any] | None = ..., drop: list[Hashable] | None = ... | ||
| ): ... | ||
|
|
||
| class FrozenHashError(TypeError): ... | ||
|
|
||
| class FrozenDict(dict): | ||
| def updated(self, *a, **kw): ... | ||
| @classmethod | ||
| def fromkeys(cls, keys: Iterable | None, value: Any | None = ...): ... | ||
| def __reduce_ex__(self, protocol): ... | ||
| def __hash__(self) -> int: ... | ||
| def __copy__(self) -> FrozenDict: ... | ||
| __ior__: Callable[[Any], Never] | ||
| __setitem__: Callable[[Any], Never] | ||
| __delitem__: Callable[[Any], Never] | ||
| update: Callable[[Any], Never] | ||
| setdefault: Callable[[Any], Never] | ||
| pop: Callable[[Any], Never] | ||
| popitem: Callable[[Any], Never] | ||
| clear: Callable[[Any], Never] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.