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

Python3 Update #32

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Python3 Update #32

wants to merge 11 commits into from

Conversation

StephenBrown2
Copy link

@StephenBrown2 StephenBrown2 commented Feb 27, 2020

Required for moving https://github.com/openaps/openaps to Python3 as the deps are dropping py2 support like hot potatoes.

Significant changes:

  • Python3 has no long type, it's all just int, so BangLong now returns an int without the L suffix.
  • / now always does float division, while // does Python2-style integer division. Most of the time this is expected, as there is a float somewhere in the calculation. However, some places I believe an integer is expected:
  • To ensure the same results were gotten in tests, I added sort_keys=True to all the json.dumps calls, e.g. here
  • Similarly, all strings are now unicode in Python3, whereas we are working with raw bytes, so I needed to add 'raw_unicode_escape' to the comparison in several tests

Copy link
Contributor

@scottleibrand scottleibrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything here intended to change behavior, or otherwise concerning. If testing looks good, I think this is good to merge.

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

Successfully merging this pull request may close these issues.

2 participants