2222from collections .abc import Callable , Generator
2323from contextlib import contextmanager
2424
25- from ._typings import Any , Self
25+ from . import _typings as t
2626
2727__all__ = ["PrioritySemaphore" , "priority_context" ]
2828
3434class PriorityWaiter (tuple [int , float , asyncio .Future [None ]]):
3535 __slots__ = ()
3636
37- def __new__ (cls , priority : int , ts : float , future : asyncio .Future [None ]) -> Self :
37+ def __new__ (cls , priority : int , ts : float , future : asyncio .Future [None ]) -> t . Self :
3838 return super ().__new__ (cls , (priority , ts , future ))
3939
4040 @property
@@ -57,10 +57,10 @@ def cancelled(self) -> Callable[[], bool]:
5757 def done (self ) -> Callable [[], bool ]:
5858 return self .future .done
5959
60- def __await__ (self ) -> Generator [Any , Any , None ]:
60+ def __await__ (self ) -> Generator [t . Any , t . Any , None ]:
6161 return self .future .__await__ ()
6262
63- def __lt__ (self , other : Any ) -> bool :
63+ def __lt__ (self , other : t . Any ) -> bool :
6464 if not isinstance (other , PriorityWaiter ):
6565 return NotImplemented
6666 return self [:2 ] < other [:2 ]
@@ -82,7 +82,7 @@ def priority_context(priority: int, /) -> Generator[None, None, None]:
8282 _priority .reset (token )
8383
8484
85- _default : Any = object ()
85+ _default : t . Any = object ()
8686
8787
8888class PrioritySemaphore :
0 commit comments