Skip to content

fix: fix type hint of Timeline.to_annotation - #98

Closed
lukasstorck wants to merge 1 commit into
pyannote:developfrom
lukasstorck:develop
Closed

fix: fix type hint of Timeline.to_annotation#98
lukasstorck wants to merge 1 commit into
pyannote:developfrom
lukasstorck:develop

Conversation

@lukasstorck

Copy link
Copy Markdown

If generator is set to None, the function would raise an Exception in line 1067 when next(generator) is call on None. So I guess generator should never be None.

At first I only wanted to correct the duplicate None in the type hint, so I would update the type hint, if None is handled in any other way.

@lukasstorck

Copy link
Copy Markdown
Author

I guess what happened was, when the type hints were first added in the new line 921, it was first though of as a Generator with Generator[Label, None, None], which can also be expressed as Iterator[Label] (see typing.Generator).

@hbredin

hbredin commented Jan 12, 2025

Copy link
Copy Markdown
Member

Closing in favor of #96

@hbredin hbredin closed this Jan 12, 2025
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.

2 participants