-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathheapq_.py
41 lines (36 loc) · 1009 Bytes
/
heapq_.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Generate `pyi` from corresponding `rst` docs.
"""
import rst
from rst2pyi import RST2PyI
__author__ = rst.__author__
__copyright__ = rst.__copyright__
__license__ = rst.__license__
__version__ = "7.5.3" # Version set by https://github.com/hlovatt/tag2ver
def heapq(shed: RST2PyI) -> None:
shed.module(
name="heapq",
old="heap queue algorithm",
post_doc="""
from typing import TypeVar, Any, Final
_T: Final = TypeVar("_T")
""",
end="Functions",
)
shed.consume_minuses_underline_line(and_preceding_lines=True)
shed.def_(
old=".. function:: heappush(heap, item)",
new="def heappush(heap: list[_T], item: _T, /) -> None",
indent=0,
)
shed.def_(
old=".. function:: heappop(heap)",
new="def heappop(heap: list[_T], /) -> _T",
indent=0,
)
shed.def_(
old=".. function:: heapify(x)",
new="def heapify(x: list[Any], /) -> None",
indent=0,
)
shed.write(u_also=True)