Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33534cf

Browse files
committed
Fix mutable default args in call signature.
Note that default arguments are used in all function calls. This means that you can get some unexpected storage of previous defaults! It’s best practice not to do this.
1 parent f3b7821 commit 33534cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plotly/graph_objs/figure_factory.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ def create_candlestick(open, high, low, close,
877877
@staticmethod
878878
def create_distplot(hist_data, group_labels,
879879
bin_size=1., curve_type='kde',
880-
colors=[], rug_text=[],
880+
colors=None, rug_text=None,
881881
show_hist=True, show_curve=True,
882882
show_rug=True):
883883
"""
@@ -992,6 +992,8 @@ def create_distplot(hist_data, group_labels,
992992
validate=False)
993993
```
994994
"""
995+
colors = colors if colors is not None else []
996+
rug_text = rug_text if rug_text is not None else []
995997
FigureFactory._validate_distplot(hist_data, curve_type)
996998
FigureFactory._validate_equal_length(hist_data, group_labels)
997999

0 commit comments

Comments
 (0)