Skip to content

Commit 90bbd5a

Browse files
committed
PRIMITIVES.md add @asyn.cancellable syntax warning.
1 parent 8239a3d commit 90bbd5a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

PRIMITIVES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ await asyn.Cancellable(print_nums, 5) # single arg to print_nums.
559559
loop = asyncio.get_event_loop()
560560
loop.create_task(asyn.Cancellable(print_nums, 42)()) # Note () syntax.
561561
```
562+
**NOTE** A coro declared with `@asyn.cancellable` must only be launched using
563+
the above syntax options. Treating it as a conventional coro will result in
564+
`tuple index out of range` errors or other failures.
562565

563566
The following will cancel any tasks still running, pausing until cancellation
564567
is complete:

0 commit comments

Comments
 (0)