Skip to content

Make Python 2.7 division behave like Python 3 #211

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

Closed
wants to merge 1 commit into from
Closed

Make Python 2.7 division behave like Python 3 #211

wants to merge 1 commit into from

Conversation

eumiro
Copy link
Contributor

@eumiro eumiro commented Jan 15, 2021

Add from __future__ import division to make Python 2.7 code behave just like Python 3 in an integer division and fix those divisions.

This allows to remove Python 2 numeric hacks that convert an integer to a float to get a float in a division. a/b for two integers now always returns a float.

Do you have any plans to drop support for Python 2.7 anyway?

@karimbahgat
Copy link
Collaborator

Thanks! But I think I'll wait with this type of change until we're ready to completely drop Python 2, since that will likely be a larger effort with possible bugs. See my answer to #225.

@karimbahgat karimbahgat closed this Feb 2, 2022
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.

2 participants