Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Python 2 cleanup #17583

Merged
merged 5 commits into from
Feb 15, 2020
Merged

Python 2 cleanup #17583

merged 5 commits into from
Feb 15, 2020

Conversation

leezu
Copy link
Contributor

@leezu leezu commented Feb 13, 2020

Description

This PR drops some Python 2 compatibility code from the codebase. Makes the code easier to read.

Changes

  • Drop some python 2 compatibility handlers from mxnet python package and tests

Copy link
Contributor

@larroy larroy left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -391,7 +390,7 @@ testing datasets.


def write_sentences(sentences, file_path):
with io.open(file_path, 'w', encoding='utf-8') as of:
with open(file_path, 'w', encoding='utf-8') as of:
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't utf8 by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Default is platform dependent. https://docs.python.org/3/library/functions.html#open

Copy link
Contributor

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

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

Great job! LGTM! Thanks!

ci/docker/runtime_functions.sh Show resolved Hide resolved
@leezu leezu merged commit f619c52 into apache:master Feb 15, 2020
@leezu leezu deleted the py2cleanup branch February 15, 2020 01:31
zheyuye pushed a commit to zheyuye/incubator-mxnet that referenced this pull request Feb 19, 2020
* Drop _cy2

* Drop Python 2 specific code in mxnet and tests

* Replace io.open with open

* Drop from __future__ imports

* Fix lint
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request May 29, 2020
* Drop _cy2

* Drop Python 2 specific code in mxnet and tests

* Replace io.open with open

* Drop from __future__ imports

* Fix lint
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

3 participants