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

Imported division from __future__ for Python 2 compatibility #4

Merged
merged 3 commits into from Jan 1, 2015

Conversation

jfsantos
Copy link
Contributor

Turns out fixing this for Python 2 was very simple. The only issue was that in Python 2, the behaviour of the division operator / changes to integer division when both operands are integers. This pull request just adds from __future__ import division to all files to change this to the Python 3 behaviour (division is always float division). This does not need to be in a separate branch of the package, as this statement does nothing in Python 3, so the same codebase works both in Python 2 and 3.

@detly
Copy link
Owner

detly commented Dec 30, 2014

Could you also update the docs to reflect this? (The top level readme and docs/details.rst are the only places, I think.)

@jfsantos
Copy link
Contributor Author

Sure. What about adding a blurb under "Dependencies" and removing the mention to Python 3?

@detly
Copy link
Owner

detly commented Dec 30, 2014

No, I tend to think of the language (version) as more than a dependency.
You'll notice that "Python 3" is already mentioned; just update that.

Sorry to argue over a 1 char change, but I'm not at my coding computer
right now :)
On 30/12/2014 12:16 PM, "João Felipe Santos" notifications@github.com
wrote:

Sure. What about adding a blurb under "Dependencies"?


Reply to this email directly or view it on GitHub
#4 (comment).

@jfsantos
Copy link
Contributor Author

No problem... and done!

detly added a commit that referenced this pull request Jan 1, 2015
Imported division from __future__ for Python 2 compatibility
@detly detly merged commit e63be1d into detly:master Jan 1, 2015
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

2 participants