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

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Aug 15, 2018

cmp() was removed in Python 3 so this PR recreates it if required leveraging the formula at http://python-future.org/compatible_idioms.html#cmp

Description

Define cmp() in Python 3

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Define cmp() in Python 3

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@cclauss cclauss changed the title Define cmp() in Python 3 for line 222 [MXNET-696] Define cmp() in Python 3 for line 222 Aug 15, 2018
@vandanavk
Copy link
Contributor

@piyushghai

try:
cmp # Python 2
except NameError:
def cmp(x, y): # Python 3
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the formula link here as well in comments ?

@piyushghai
Copy link
Contributor

LGTM

Copy link
Contributor

@vandanavk vandanavk left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@sandeep-krishnamurthy sandeep-krishnamurthy left a comment

Choose a reason for hiding this comment

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

Thanks!
LGTM

@sandeep-krishnamurthy sandeep-krishnamurthy merged commit 54ed3e5 into apache:master Aug 17, 2018
@cclauss cclauss deleted the patch-2 branch August 17, 2018 16:27
marcoabreu added a commit that referenced this pull request Aug 17, 2018
piyushghai added a commit to piyushghai/incubator-mxnet that referenced this pull request Aug 17, 2018
vandanavk added a commit to vandanavk/incubator-mxnet that referenced this pull request Aug 17, 2018
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
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.

4 participants