File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def __init__(self) -> None:
58
58
def internal_add (self , * handlers : EventHandler ) -> None :
59
59
for h in handlers :
60
60
self .handlers .setdefault (h .flow .priority , set ()).add (h )
61
- h .flow .on_priority_reset (lambda new_prior , h = h : self .reset (h , new_prior ))
61
+ h .flow .on_priority_reset (lambda new_prior , h = h : self ._reset (h , new_prior ))
62
62
63
63
async def add (self , * handlers : EventHandler ) -> None :
64
64
async with self .broadcast_ctrl .write ():
@@ -76,7 +76,7 @@ async def expire(self, *handlers: EventHandler) -> None:
76
76
async with self .broadcast_ctrl .write ():
77
77
await self ._remove (* handlers )
78
78
79
- async def reset (self , handler : EventHandler , new_prior : HandleLevel ) -> None :
79
+ async def _reset (self , handler : EventHandler , new_prior : HandleLevel ) -> None :
80
80
if handler .flow .priority == new_prior :
81
81
return
82
82
Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ async def suspend(timeout: float | None = None) -> bool:
264
264
:param timeout: 挂起后再唤醒的超时时间, 为空则永不超时
265
265
:return: 如果为 `False` 则表明唤醒超时
266
266
"""
267
- return await SessionCtx () .get ().__suspend__ (timeout )
267
+ return await _SESSION_CTX .get ().__suspend__ (timeout )
268
268
269
269
270
270
def enter_session (
Original file line number Diff line number Diff line change 14
14
ContextManager ,
15
15
Coroutine ,
16
16
Literal ,
17
- TypeVar ,
18
17
cast ,
19
18
)
20
19
21
- from typing_extensions import Self
20
+ from typing_extensions import Self , TypeVar
22
21
23
22
from .exceptions import ValidateError
24
23
from .typ import AsyncCallable , P , T
@@ -349,10 +348,10 @@ def to_coro(
349
348
return to_async (obj )(* args , ** kwargs ) # type: ignore[arg-type]
350
349
351
350
352
- CbRetT = TypeVar ("CbRetT" )
353
- FirstCbRetT = TypeVar ("FirstCbRetT" )
354
- SecondCbRetT = TypeVar ("SecondCbRetT" )
355
- OriginRetT = TypeVar ("OriginRetT" )
351
+ CbRetT = TypeVar ("CbRetT" , default = Any )
352
+ FirstCbRetT = TypeVar ("FirstCbRetT" , default = Any )
353
+ SecondCbRetT = TypeVar ("SecondCbRetT" , default = Any )
354
+ OriginRetT = TypeVar ("OriginRetT" , default = Any )
356
355
357
356
358
357
def if_not (
You can’t perform that action at this time.
0 commit comments