Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Partial Python 3 support #44

Merged
merged 8 commits into from Aug 1, 2016
Merged

Partial Python 3 support #44

merged 8 commits into from Aug 1, 2016

Conversation

bbayles
Copy link
Collaborator

@bbayles bbayles commented Jul 30, 2016

This PR builds upon the ideas in #22 and introduces partial support for Python 3. I'm not ready to consider Python 3 "well-supported" quite yet, as #25 (keys are coerced to strings) is more visible on Python 3.

Notes:

  • I went ahead and used six as the compatibility layer, rather than writing and testing a custom compatibility layer.
  • I've defensively added __future__ imports for Python 2 to try to keep behaviors between the major versions as similar as possible (I don't think they're doing much work in practice)
  • I've made some style changes as recommended by flake8. I'm not enforcing flake8-correctness in Travis yet, but probably will eventually.
  • Keys get coerced to unicode strings instead of byte strings now. This doesn't mean much on Python 2, but it does make it difficult to retrieve bytes objects in Python 3 (previously it was difficult to retrieve str objects on Python 3).

@honzajavorek
Copy link
Collaborator

Big +1 to flake8!

On 30 Jul 2016 5:04 p.m., "Bo Bayles" notifications@github.com wrote:

This PR builds upon the ideas in #22
#22 and
introduces partial support for Python 3. I'm not ready to consider Python 3
"well-supported" quite yet, as #22
#22 (keys are
coerced to strings) is more visible on Python 3.

Notes:

  • I went ahead and used six as the compatibility layer, rather than
    writing and testing a custom compatibility layer.
  • I've defensively added future imports for Python 2 to try to
    keep behaviors between the major versions as similar as possible (I don't
    think they're doing much work in practice)
  • I've made some style changes as recommended by flake8
    http://flake8.pycqa.org/en/latest/. I'm enforcing flake8-correctness
    in Travis yet, but probably will eventually.
  • Keys get coerced to unicode strings instead of byte strings now.
    This doesn't mean much on Python 2, but it does make it difficult to
    retrieve bytes objects in Python 3 (previously it was difficult to
    retrieve str objects on Python 3).

You can view, comment on, or merge this pull request online at:

#44
Commit Summary

  • Placate flake8
  • Add future imports
  • Add six to the mix
  • Partial Python 3 support
  • Update docs with Known Issues
  • Add six to requirements.txt
  • Test on Python 3

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#44, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AARTMX2Ro71ke0--dWrXPfQF72Qb_8fFks5qa2f3gaJpZM4JY0xL
.

@bbayles bbayles mentioned this pull request Jul 30, 2016
@bbayles bbayles merged commit 7e408c6 into master Aug 1, 2016
@bbayles bbayles deleted the partial-python3 branch August 1, 2016 00:30
@bbayles
Copy link
Collaborator Author

bbayles commented Aug 1, 2016

This is in so more drastic changes to solve #25 (keys are strings) can go forward.

@honzajavorek
Copy link
Collaborator

I went ahead and used six as the compatibility layer

👍

I think the most difficult part of the Python 3 support is the unicode/str/bytes confusion indeed. At the time people started to request support for 3 here I didn't even use it yet (I do regularly now), so it was very hard for me to not only spot, but to correctly solve all the corner cases. Thanks for all the great work and thorough approach!

@@ -2,6 +2,9 @@ sudo: false
language: "python"
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉 🎉

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

Successfully merging this pull request may close these issues.

None yet

2 participants