Skip to content

Commit d4302cc

Browse files
nicholas-esterernicolaskruchten
authored andcommitted
better cast to generator
1 parent 08e29a0 commit d4302cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: packages/python/plotly/plotly/basedatatypes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ def _axis_spanning_shapes_docstr(shape_type):
384384

385385
def _generator(i):
386386
""" "cast" an iterator to a generator """
387-
while True:
388-
yield next(i)
387+
for x in i:
388+
yield x
389389

390390

391391
class BaseFigure(object):

0 commit comments

Comments
 (0)