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

Remove most of the python 2 compat code #537

Merged
merged 15 commits into from
Aug 18, 2020
Merged

Remove most of the python 2 compat code #537

merged 15 commits into from
Aug 18, 2020

Conversation

rahulporuri
Copy link
Contributor

@rahulporuri rahulporuri commented Aug 17, 2020

Note to reviewer : I have tried making one and only one type of change in each of the commits so reviewing this PR commit-by-commit will be straightforward.

This PR removes most of the machinery in the codebase that supported python 2/3 compatibility.

  • remove __future__ import statements
  • remove coding/encoding cookies from files
  • remove try/except statements around imports that have changed between python 2 and 3
  • use str instead of py3compat.unicode_type
  • use str instead of py3compat.string_types
  • use dict.items() instead of py3compat.iteriterms(dict)
  • Remove a python 2 only test
  • Remove py3compat.PY3 conditionals
  • Use metaclass kwarg instead of py3compat.with_metaclass
  • Use builtins instead of py3compat.builtin_mod
  • Use func.__closure__ instead of py3compat.get_closure(func)
  • Remove py3compat.*_py2 functions which are no-op on python 3

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! We picked up a few merge conflicts from #538, mind doing a rebase?

@rahulporuri
Copy link
Contributor Author

@blink1073 i think I rebased correctly and didn't mess anything up.

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Great, thank you!

@blink1073 blink1073 merged commit 14f8fd8 into ipython:master Aug 18, 2020
@rahulporuri rahulporuri deleted the cln/remove-py2-compat-code branch August 18, 2020 17:42
@Carreau Carreau added this to the 5.4 milestone Jun 14, 2021
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.

3 participants