Skip to content

Conversation

@ppomorsk
Copy link
Contributor

This is another way to fix a bug caused by expecting a floating point answer from integer division. This could be helpful to users who are really uncomfortable with the way Python 2 does integer division.

This is another way to fix a bug caused by expecting a floating point answer from integer division.  This could be helpful to users who are really uncomfortable with the way Python 2 does integer division.
@abostroem
Copy link
Contributor

This seems like it might create more confusion that it helps. For instance I can see students typing that in the notebook and then having integer division turned off for the remaining part of the session. I think this could be mentioned in passing (possibly called out in the instructor notes), but I'm -1 for including it in the lesson. Other thoughts?

@iglpdc
Copy link
Contributor

iglpdc commented May 15, 2015

I agree with @abostroem. It can be confusing.

I maybe good thought to have a callout here mentioning that this has changed in Python 3. I think Python 3 is not mentioned at all in the lesson. So, it could be good to have a callout "Two Python dialects" or something like that, where we explain that there are to major versions of Python, that they are incompatible, and this is one of the differences.

People is likely to see this in the internet or try to use code for one version in the other. Also it's not strange to have someone who accidentally installed Python 3 and is "complaining" about not getting in 10/3 = 3.

@drj11
Copy link

drj11 commented May 15, 2015

I agree @abostroem too. As well as the already mentioned risk of having some part of the group with integer division and some part with floating point division, I think the syntax and semantics of from __future__ are not novice material: the double underscore thing just looks weird; from __future__ has the magic effect of changing the language which no other sort of import can do.

+1 for a "Two Python Dialects" callout.

@ppomorsk
Copy link
Contributor Author

I agree with the comments, this change may indeed introduce confusion.

Python 3 does actually get a one sentence mention in this lesson already. (quote: " It's still confusing, though, so Python 3 produces a floating-point answer when dividing integers if it needs to.") This is the only mention of Python 3 that I can see in the entire "Programming with Python" workshop.

It would be good to add some note about the two dialects of Python, maybe somewhere in the introduction.

A deeper question is whether this workshop should just be entirely switched to Python 3, but that's a topic for a longer discussion.

@abostroem abostroem closed this May 22, 2015
k8hertweck pushed a commit to k8hertweck/python-novice-inflammation that referenced this pull request Sep 26, 2016
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.

4 participants