Skip to content

Commit 3097032

Browse files
better cast to generator
1 parent d0102f1 commit 3097032

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
@@ -156,8 +156,8 @@ def _axis_spanning_shapes_docstr(shape_type):
156156

157157
def _generator(i):
158158
""" "cast" an iterator to a generator """
159-
while True:
160-
yield next(i)
159+
for x in i:
160+
yield x
161161

162162

163163
class BaseFigure(object):

0 commit comments

Comments
 (0)