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

'division_safe' fix applied #8084

Closed
wants to merge 2 commits into from

Conversation

vilnius-dev
Copy link
Contributor

This fix used instead of libfuturize.fixes.fix_division.

Division
Integer division (rounding down):

# Python 2 only:
assert 2 / 3 == 0
# Python 2 and 3:
assert 2 // 3 == 0

“True division” (float division):

# Python 3 only:
assert 3 / 2 == 1.5
# Python 2 and 3:
from __future__ import division    # (at top of module)

assert 3 / 2 == 1.5

“Old division” (i.e. compatible with Py2 behaviour):

# Python 2 only:
a = b / c            # with any types
# Python 2 and 3:
from past.utils import old_div

a = old_div(b, c)    # always same as / on Py2

@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
    • 2 changes in unstable tests
  • Pylint check: failed
    • 362 warnings and errors that must be fixed
    • 56 warnings
    • 1611 comments to review
  • Pycodestyle check: succeeded
    • 2947 comments to review
  • Python3 compatibility checks: succeeded
    • there are suggested fixes for newer python3 idioms

Details at https://cmssdt.cern.ch/jenkins/view/All/job/DMWM-WMCore-PR-test/5665/artifact/artifacts/PullRequestReport.html

@ericvaandering
Copy link
Member

This one, I think, requires some thought and we should make an attempt to discern which of these things are expecting ints and which are expecting floats as a result.

This will take some effort, but will leave us with better, less ugly code.

@vilnius-dev
Copy link
Contributor Author

@ticoann As we discussed on meeting this PR could be closed.
I making changes "by hand", results can be viewed here: #8125

@amaltaro amaltaro closed this Sep 8, 2017
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

4 participants