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" ?)

    Sebastian Haase
    Sebastian Haase, Apr 18, 2004
    1. Advertisements

  2. Sebastian Haase

    John Roth Guest

    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
    John Roth, Apr 18, 2004
    1. Advertisements

  3. Sebastian Haase

    Greg Ewing Guest


    Ah, so *that's* why my code isn't running fast enough...
    Greg Ewing, Apr 20, 2004
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.