mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 11:51:28 +08:00
Add the optional key and reverse parameters: https://docs.python.org/3.5/library/heapq.html#heapq.merge
This commit is contained in:
committed by
Guido van Rossum
parent
a277980d99
commit
9acc9b31ac
@@ -2,6 +2,7 @@
|
||||
|
||||
# Based on http://docs.python.org/3.2/library/heapq.html
|
||||
|
||||
import sys
|
||||
from typing import TypeVar, List, Iterable, Any, Callable
|
||||
|
||||
_T = TypeVar('_T')
|
||||
@@ -11,7 +12,11 @@ def heappop(heap: List[_T]) -> _T: ...
|
||||
def heappushpop(heap: List[_T], item: _T) -> _T: ...
|
||||
def heapify(x: List[_T]) -> None: ...
|
||||
def heapreplace(heap: List[_T], item: _T) -> _T: ...
|
||||
def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] = ...,
|
||||
reverse: bool = ...) -> Iterable[_T]: ...
|
||||
else:
|
||||
def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... # type: ignore
|
||||
def nlargest(n: int, iterable: Iterable[_T],
|
||||
key: Callable[[_T], Any] = ...) -> List[_T]: ...
|
||||
def nsmallest(n: int, iterable: Iterable[_T],
|
||||
|
||||
Reference in New Issue
Block a user