campaining for PEP 238 - integer division

Discussion in 'Python' started by Sebastian Haase, Apr 18, 2004.

  1. 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
     
    Sebastian Haase, Apr 18, 2004
    #1
    1. Advertising

  2. Sebastian Haase

    John Roth Guest

    "Sebastian Haase" <> wrote in message
    news:...
    > 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
     
    John Roth, Apr 18, 2004
    #2
    1. Advertising

  3. Sebastian Haase

    Greg Ewing Guest

    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
     
    Greg Ewing, Apr 20, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    12
    Views:
    1,928
  2. genlock
    Replies:
    22
    Views:
    26,307
    vipinlal
    Mar 17, 2010
  3. Darius Fatakia

    integer division

    Darius Fatakia, Jan 28, 2004, in forum: C++
    Replies:
    2
    Views:
    464
    Howard
    Jan 28, 2004
  4. Sidney Cadot

    integer division towards -infinity

    Sidney Cadot, Jul 10, 2003, in forum: C Programming
    Replies:
    3
    Views:
    631
    Glen Herrmannsfeldt
    Jul 11, 2003
  5. Replies:
    94
    Views:
    4,629
    ┬Ča\\/b
    Feb 9, 2007
Loading...

Share This Page