Skip to content

Commit e668396

Browse files
committed
add PosArgT typing to run()
1 parent a7db0e4 commit e668396

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/trio/_core/_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,8 +2184,8 @@ def setup_runner(
21842184

21852185

21862186
def run(
2187-
async_fn: Callable[..., Awaitable[RetT]],
2188-
*args: object,
2187+
async_fn: Callable[[Unpack[PosArgT]], Awaitable[RetT]],
2188+
*args: Unpack[PosArgT],
21892189
clock: Clock | None = None,
21902190
instruments: Sequence[Instrument] = (),
21912191
restrict_keyboard_interrupt_to_checkpoints: bool = False,

src/trio/_core/_tests/test_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def trivial(x: T) -> T:
7676

7777
with pytest.raises(TypeError):
7878
# Missing an argument
79-
_core.run(trivial)
79+
_core.run(trivial) # type: ignore[arg-type]
8080

8181
with pytest.raises(TypeError):
8282
# Not an async function

0 commit comments

Comments
 (0)