-
Notifications
You must be signed in to change notification settings - Fork 52
docs: Add USAGE.md #34
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
Conversation
| @@ -1,3 +1,6 @@ | |||
| # Python 2/3 compatible codebase | |||
| from __future__ import absolute_import, division, print_function | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original last line on examples/example.py is print header.json_string() instead of print(header.json_string()) . I thought it might be intentional not an error or typho to keep the python2 version than upgrade to python3 by just change to print(). That's why I add this line. The from__future__ import absolute_import means that if py2 user import string, python will look for upper-level string module, rather than current_package.string, this will prevent error in module import. from __future__ import absolute_import, print_function enable the scripts backward compatibility with python2 while moving to python3 version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NEAT!!
|
This is great work - I am just confused about that future statement, as I am not sure it's necessary. |
What does this PR do?
Close #32
Checklist
Short description of what this PR does: