Skip to content

Add functools._make_key #5370

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

Merged
merged 7 commits into from
May 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion stdlib/functools.pyi
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import sys
from _typeshed import SupportsLessThan
from _typeshed import SupportsItems, SupportsLessThan
from typing import (
Any,
Callable,
Dict,
Generic,
Hashable,
Iterable,
List,
Mapping,
NamedTuple,
Optional,
Sequence,
Set,
Sized,
Tuple,
Type,
TypeVar,
Expand Down Expand Up @@ -131,3 +134,20 @@ if sys.version_info >= (3, 8):

if sys.version_info >= (3, 9):
def cache(__user_function: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...

class _HashedSeq(Generic[_T], List[_T]):
__slots__: str
hashvalue: int
def __init__(self, tup: Tuple[Any, ...], hash: Callable[[object], int] = ...) -> None: ...
def __hash__(self) -> int: ... # type: ignore

def _make_key(
args: Tuple[Hashable, ...],
kwds: SupportsItems[Any, Any],
typed: bool,
kwd_mark: Tuple[object, ...] = ...,
fasttypes: Set[type] = ...,
tuple: type = ...,
type: Any = ...,
len: Callable[[Sized], int] = ...,
) -> Union[Hashable, _HashedSeq[Any]]: ...