documentation icon indicating copy to clipboard operation
documentation copied to clipboard

switch notebooks to be python 2 and 3 compatible?

Open chriddyp opened this issue 6 years ago • 7 comments

seems like there is some confusion that our library might not be python 3 compatible because our docs are written in python 2

image

chriddyp avatar Jan 10 '19 22:01 chriddyp

@chriddyp do you have the specific tutorial this is referring to? I think this user may actually be referring to the plotly.py version in each notebook.

cldougl avatar Jan 10 '19 22:01 cldougl

I don't. Here's the full thread where I saw this: https://twitter.com/koehrsen_will/status/1083021973414907906

Looks like some notebooks have plotly.__version__ and others have print plotly.__version__. I think he's referring to the latter (where in Python 3 it's print(plotly.__version)) screen shot 2019-01-10 at 5 32 39 pm

chriddyp avatar Jan 10 '19 22:01 chriddyp

@priyatharsan instead of printing the version the version check should be:

screen shot 2019-01-17 at 12 06 44 pm

to avoid any python 2 vs 3 confusion.

cldougl avatar Jan 17 '19 17:01 cldougl

Took me a while to catch the distinction! basically we want to avoid print altogether?

nicolaskruchten avatar Jan 21 '19 16:01 nicolaskruchten

@nicolaskruchten in this context I guess so since it seems to confuse some users and is not necessary to display the version.

cldougl avatar Jan 21 '19 16:01 cldougl

print(plotly.__version__) is also python 2 & python 3 compatible

chriddyp avatar Jan 21 '19 17:01 chriddyp

we can use that for necessary print statements throughout other docs but since most pages call plotly.__verison__ at this point anyway I think it will be easier to move toward using that syntax consistently

cldougl avatar Jan 21 '19 18:01 cldougl