By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

campaining for PEP 238 - integer division

P: n/a
Hi,
I'm interested in having more people in our lab using numarray/NumPy
instead of MatLab. For that I have put together a couple useful
modules and written many myself. But then I got reminded of a new /
upcoming feature of Python:
"2/3 == 1.5" AKA PEP 238.
I'm very interested in putting lots of
"from __future__ import division"
lines into my code especially since numarray (the new NumPy) now
supports it.

QUESTION: Is this new/upcoming feature of Python mentioned enough ?
Like in the Python tutorial or mailing lists ...
A google groups search for "python 238 integer OR division" was
giving me one relevant result from Jan2004, another one from May2003,
all else even older !!!

I think people need to be reminded that PEP238 is really happening
and especially new people should be pointed to this --
The fact is that changing something as fundamental as the division
operator WILL BRAKE LOTS OF CODE !! I'm just thinking of all the
'a[n/2]' expressions I have in my code.

PROPOSAL: This is why I would like to see some special treatment for
PEP 238. If the division operator is going to change this should be
noted right in the first chapter of the Python tutorial (Python as
calculator). Remind all python developers that they will have to
change their code. (Actually: is there an easy 'fix' like "from
__past__ import division" ?)

Cheers,
Sebastian Haase
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Sebastian Haase" <se*******@yahoo.com> wrote in message
news:f4**************************@posting.google.c om...
Hi,
I'm interested in having more people in our lab using numarray/NumPy
instead of MatLab. For that I have put together a couple useful
modules and written many myself. But then I got reminded of a new /
upcoming feature of Python:
"2/3 == 1.5" AKA PEP 238.
I'm very interested in putting lots of
"from __future__ import division"
lines into my code especially since numarray (the new NumPy) now
supports it.

QUESTION: Is this new/upcoming feature of Python mentioned enough ?
Like in the Python tutorial or mailing lists ...
A google groups search for "python 238 integer OR division" was
giving me one relevant result from Jan2004, another one from May2003,
all else even older !!!
According to the current version of the PEP, that change won't
happen until sometime in the misty future with version 3.0. That
release is scheduled to break lots of things, not just this one.

The PEP contains recommendations for cushioning the shock.

John Roth

Cheers,
Sebastian Haase

Jul 18 '05 #2

P: n/a
Sebastian Haase wrote:
The fact is that changing something as fundamental as the division
operator WILL BRAKE LOTS OF CODE !!

^^^^^

Ah, so *that's* why my code isn't running fast enough...

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.