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

Code normalization for Python 3 + general cleanup #391

Merged
merged 4 commits into from
Feb 20, 2016

Conversation

bintoro
Copy link
Member

@bintoro bintoro commented Feb 15, 2016

This set of commits standardizes on Python 3 style and replaces ad-hoc compatibility maneuvers with a shared compatibility module compat. It is deployed to all modules via from .common import *.

Changes to string handling:

  • str now produces Unicode strings; unicode is obsolete.
  • unicode_literals is now enabled; u-prefixes are obsolete.

On Python 2, the __str__() and __repr__() methods on Model and FieldError are patched to transparently encode non-ASCII code points.

All modules now declare __all__ to prevent globals from leaking on from <> import *.

The six dependency is gone.

* Add `compat` module as a shared compatibility layer.
* Remove `six` dependency.
* Switch to Python 3 style by using `str` in place of `unicode`.
* Declare `__all__` in modules so as not to export masked builtins.
bintoro added a commit that referenced this pull request Feb 20, 2016
Code normalization for Python 3 + general cleanup
@bintoro bintoro merged commit 4fdca50 into schematics:development Feb 20, 2016
@bintoro bintoro deleted the compat+cleanup branch April 30, 2016 17:18
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.

None yet

1 participant