File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import sys
2- from typing import Any , Final , TypeVar
3-
4- _T = TypeVar ("_T" ) # list items must be comparable
2+ from _typeshed import SupportsRichComparisonT as _T # All type variable use in this module requires comparability.
3+ from typing import Final
54
65__about__ : Final [str ]
76
8- def heapify (heap : list [Any ], / ) -> None : ... # list items must be comparable
7+ def heapify (heap : list [_T ], / ) -> None : ...
98def heappop (heap : list [_T ], / ) -> _T : ...
109def heappush (heap : list [_T ], item : _T , / ) -> None : ...
1110def heappushpop (heap : list [_T ], item : _T , / ) -> _T : ...
1211def heapreplace (heap : list [_T ], item : _T , / ) -> _T : ...
1312
1413if sys .version_info >= (3 , 14 ):
15- def heapify_max (heap : list [Any ], / ) -> None : ... # list items must be comparable
14+ def heapify_max (heap : list [_T ], / ) -> None : ...
1615 def heappop_max (heap : list [_T ], / ) -> _T : ...
1716 def heappush_max (heap : list [_T ], item : _T , / ) -> None : ...
1817 def heappushpop_max (heap : list [_T ], item : _T , / ) -> _T : ...
Original file line number Diff line number Diff line change 11import sys
2+ from _typeshed import SupportsRichComparisonT
23from asyncio .events import AbstractEventLoop
34from types import GenericAlias
45from typing import Any , Generic , TypeVar
@@ -50,5 +51,5 @@ class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
5051 if sys .version_info >= (3 , 13 ):
5152 def shutdown (self , immediate : bool = False ) -> None : ...
5253
53- class PriorityQueue (Queue [_T ]): ...
54+ class PriorityQueue (Queue [SupportsRichComparisonT ]): ...
5455class LifoQueue (Queue [_T ]): ...
Original file line number Diff line number Diff line change 11import sys
22from _queue import Empty as Empty , SimpleQueue as SimpleQueue
3+ from _typeshed import SupportsRichComparisonT
34from threading import Condition , Lock
45from types import GenericAlias
56from typing import Any , Generic , TypeVar
@@ -47,8 +48,8 @@ class Queue(Generic[_T]):
4748 def task_done (self ) -> None : ...
4849 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
4950
50- class PriorityQueue (Queue [_T ]):
51- queue : list [_T ]
51+ class PriorityQueue (Queue [SupportsRichComparisonT ]):
52+ queue : list [SupportsRichComparisonT ]
5253
5354class LifoQueue (Queue [_T ]):
5455 queue : list [_T ]
You can’t perform that action at this time.
0 commit comments