Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 compatibility #61

Closed
cclauss opened this issue Aug 20, 2017 · 5 comments
Closed

Python 3 compatibility #61

cclauss opened this issue Aug 20, 2017 · 5 comments

Comments

@cclauss
Copy link
Contributor

cclauss commented Aug 20, 2017

See #42 (comment)

Where is the dependency list? Which dependencies are not yet Python 3 compatible?

@iromise
Copy link
Member

iromise commented Aug 21, 2017

Sorry, here something I said was wrong, not package, actually some code, mainly caused by the print function.

since there is still a lot package dependency whose version is Python 2.7

So there is no dependency list... And as far as I think, possibly not right, if you can not run the given code, the message given by the system could help you solve it, this should be easy. And If we give two files(or judge in the file) in one problem, this may also be redundant. What's your opinion?

@cclauss
Copy link
Contributor Author

cclauss commented Aug 21, 2017

The 2to3 utility that ships with Python can automatically fix all print statements so that they are compatible with both Python 2 and Python 3.

At the root of your project, run 2to3 -f print . to see all the lines that need to be changed and then run 2to3 -f print -w . to actually write (-w) the changes into the files.

https://docs.python.org/2/library/2to3.html

@iromise
Copy link
Member

iromise commented Aug 21, 2017

Thanks a lot, first time to see this command. And since so, maybe one version is enough as 3to2 also exists?

@cclauss
Copy link
Contributor Author

cclauss commented Aug 21, 2017

Yes https://pypi.python.org/pypi/3to2 exists but I doubt that you would use it. The changes that I mention above will be compatible with both Py2 and Py3.

@iromise
Copy link
Member

iromise commented Aug 21, 2017

Yes, now I won't use it since I think this is not necessary as people who read this doc should have the ability to solve the conflict between Py2 and Py3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants