Skip to content

Stop/StopWithError: Allow single event types - #4

Open
gselzer wants to merge 1 commit into
marktsuchida:mainfrom
gselzer:stop-single-arg
Open

Stop/StopWithError: Allow single event types#4
gselzer wants to merge 1 commit into
marktsuchida:mainfrom
gselzer:stop-single-arg

Conversation

@gselzer

@gselzer gselzer commented Aug 13, 2026

Copy link
Copy Markdown

While working on python examples, I found that I kept wanting to write

tcspc.Stop(tcspc.WarningEvent(), "my message")

but it is currently necessary to write

tcspc.Stop((tcpsc.WarningEvent(),), "my message")

This PR allows the former to work, in addition to the later, along with some tests.

Note that there are other Nodes that take multiple event types, such as Select, but these are variadic arguments. A larger change could unify the behaviors of these Node types with Stop/StopWithEvent.

Writing

tcspc.Stop(tcspc.WarningEvent(), "my message")

is more user-friendly than

tcspc.Stop((tcpsc.WarningEvent(),), "my message")
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