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

Modernize Syntax for python 3 #206

Merged
merged 2 commits into from
Apr 19, 2022
Merged

Conversation

lucaswiman
Copy link
Collaborator

@lucaswiman lucaswiman commented Apr 19, 2022

This PR removes some superfluous syntax that is no longer needed in python 3:

  • u"strings" to "strings"
  • super(MyClass, self).method(...) to "super().method(...)

The former are literally no-ops in that the exact same bytecode is produced now with or without u-annotation on a string. The latter is usually equivalent, though not always. There is one case in this codebase which is not equivalent and I left it as-is.

@lucaswiman
Copy link
Collaborator Author

Other modernizations to consider:

  • Renaming _unicode_members.
  • Replacing .assertFoo syntax with ordinary assertions.

@lucaswiman lucaswiman merged commit 1fdd869 into erikrose:master Apr 19, 2022
@lucaswiman lucaswiman deleted the modernize branch April 19, 2022 16:48
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.

1 participant