mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
So raising StopIteration is correct?
This commit is contained in:
parent
43da1dab3a
commit
efd05a4754
1 changed files with 1 additions and 4 deletions
|
@ -377,10 +377,7 @@ def group_by_object(stream):
|
||||||
Yields ((class name, object ID), (list of messages)) pairs.
|
Yields ((class name, object ID), (list of messages)) pairs.
|
||||||
"""
|
"""
|
||||||
stream = iter(stream)
|
stream = iter(stream)
|
||||||
try:
|
current = next(stream)
|
||||||
current = next(stream)
|
|
||||||
except StopIteration:
|
|
||||||
yield StopIteration
|
|
||||||
current_key = current.cls, current.id
|
current_key = current.cls, current.id
|
||||||
group = [current]
|
group = [current]
|
||||||
for message in stream:
|
for message in stream:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue