Add basic typing to the `debugging/` examples

Sweep the `examples/debugging/` set for basic typing: add `-> None`
to all 16 bare `async def main()`s and annotate the clean
single-line `open_nursery()` bindings as `tractor.ActorNursery`.

Kept to the unambiguous, runtime-safe cases (these breakpoint/crash
demos can't be run headless); the heterogeneous
multi-line/paren-group nursery bindings + `current_actor()` returns
are left for a later pass. Continues the examples-typing bullet in

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
wkt/big_boi_docs_472_follow_ups
Gud Boi 2026-07-02 12:32:49 -04:00
parent 4c507ea13c
commit a6c1158853
16 changed files with 16 additions and 16 deletions

View File

@ -35,7 +35,7 @@ async def open_ctx(
assert first is None
async def main():
async def main() -> None:
async with tractor.open_nursery(
debug_mode=True,

View File

@ -20,7 +20,7 @@ async def name_error():
getattr(doggypants) # noqa
async def main():
async def main() -> None:
'''
Test breakpoint in a streaming actor.

View File

@ -63,7 +63,7 @@ async def spawn_until(depth=0):
# TODO: notes on the new boxed-relayed errors through proxy actors
async def main():
async def main() -> None:
"""The main ``tractor`` routine.
The process tree should look as approximately as follows when the debugger

View File

@ -23,7 +23,7 @@ async def spawn_error():
)
async def main():
async def main() -> None:
"""The main ``tractor`` routine.
The process tree should look as approximately as follows:

View File

@ -25,7 +25,7 @@ async def spawn_error():
)
async def main():
async def main() -> None:
"""The main ``tractor`` routine.
The process tree should look as approximately as follows:

View File

@ -5,7 +5,7 @@ async def die():
raise RuntimeError
async def main():
async def main() -> None:
async with tractor.open_nursery() as an:
debug_actor = await an.start_actor(

View File

@ -18,7 +18,7 @@ async def name_error(
raise
async def main():
async def main() -> None:
'''
Test 3 `PdbREPL` entries:
- one in the child due to manual `.post_mortem()`,

View File

@ -2,7 +2,7 @@ import trio
import tractor
async def main():
async def main() -> None:
async with tractor.open_root_actor(
debug_mode=True,

View File

@ -2,7 +2,7 @@ import trio
import tractor
async def main():
async def main() -> None:
async with tractor.open_root_actor(
debug_mode=True,
):

View File

@ -27,7 +27,7 @@ async def spawn_until(depth=0):
)
async def main():
async def main() -> None:
'''
The process tree should look as approximately as follows when the
debugger first engages:

View File

@ -2,7 +2,7 @@ import trio
import tractor
async def main():
async def main() -> None:
async with tractor.open_root_actor(
debug_mode=True,
loglevel='cancel',

View File

@ -7,7 +7,7 @@ async def key_error():
return {}['doggy']
async def main():
async def main() -> None:
'''
Root is fail-after-cancelled while blocking and child RPC fails
simultaneously.

View File

@ -71,7 +71,7 @@ async def cancelled_before_pause(
await pm_on_cancelled()
async def main():
async def main() -> None:
async with tractor.open_nursery(
debug_mode=True,
) as an:

View File

@ -34,7 +34,7 @@ async def just_bp(
async def main():
async def main() -> None:
# !TODO, parametrize the --tpt-proto={key} with osenv vars just
# like we do for loglevel/spawn-backend!

View File

@ -12,7 +12,7 @@ async def breakpoint_forever():
await tractor.pause()
async def main():
async def main() -> None:
async with tractor.open_nursery(
debug_mode=True,

View File

@ -6,7 +6,7 @@ async def name_error():
getattr(doggypants) # noqa (on purpose)
async def main():
async def main() -> None:
async with tractor.open_nursery(
debug_mode=True,
) as an: