Skip to content

Commit fadf8d4

Browse files
committed
Change textwrapper approach for Python2.7 compatibility
1 parent 4ca1aa3 commit fadf8d4

File tree

1 file changed

+3
-2
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+3
-2
lines changed

Diff for: packages/python/plotly/plotly/express/_doc.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import inspect
2-
from textwrap import fill, indent
2+
from textwrap import TextWrapper
33

44

55
# TODO contents of columns
@@ -437,11 +437,12 @@
437437

438438

439439
def make_docstring(fn):
440+
tw = TextWrapper(width=79, initial_indent=" ", subsequent_indent=" ")
440441
result = (fn.__doc__ or "") + "\nParameters\n----------\n"
441442
for param in inspect.getargspec(fn)[0]:
442443
param_desc_list = docs[param][1:]
443444
param_desc = (
444-
indent(fill(" ".join(param_desc_list or "")), " ")
445+
tw.fill(" ".join(param_desc_list or ""))
445446
if param in docs
446447
else "(documentation missing from map)"
447448
)

0 commit comments

Comments
 (0)