Skip to content

Conversation

@mxmpl
Copy link

@mxmpl mxmpl commented Nov 15, 2022

In Python 3, zip returns an iterator and not a list as in Python 2: it exhausts once it has been iterated over.

This behaviour causes issues in

for spkr in self.speakers:
spk_utts = [utt_id for utt_id, utt_speaker in self.utts
if utt_speaker == spkr]

as self.utts is defined in
self.utts = zip(utt_ids, utt_speakers)

For the first spkr, spk_utts is correct, but for the next ones it is an empty list as self.utts is exhausted.

This PR fixes this by changing zip(...) to list(zip(...)).

@mxmpl mxmpl self-assigned this Nov 15, 2022
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