Skip to content

Type the event callback in the generated stubs - #6

Merged
knipknap merged 1 commit into
mainfrom
fix/type-event-callback
Oct 17, 2026
Merged

knipknap merged 1 commit into
mainfrom
fix/type-event-callback

Conversation

@knipknap

Copy link
Copy Markdown
Contributor

Summary

event_callback was typed typing.Any in the generated stubs, leaving embedders without a checked contract. The stubs now declare it as typing.Optional[collections.abc.Callable[[SessionEvent], typing.Any]] via a gen_stub argument type override on both session constructors.

Stub-only change; no runtime behavior difference. Ships as 0.5.1 so Rayforge can consume the typed callback signature.

Test plan

  • make stubs regenerated; diff shows only the callback signature.
  • make check: 159 tests passed; fmt/clippy/ruff/pyright green.

The event_callback parameter was typed typing.Any, leaving
embedders without a checked contract. The stubs now declare it as
typing.Optional[collections.abc.Callable[[SessionEvent],
typing.Any]] via a gen_stub argument type override.
@knipknap
knipknap merged commit 0b7b9a1 into main Oct 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant