Linux.com: Python 3 makes a big break

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    Linux.com: Python 3 makes a big break


    Interesting article with one minor incompleteness.
    "For instance, the print statement got turned into a print function; you
    must now put parentheses around what you want to print to the screen.
    The change allows developers to work with print in a more flexible and
    uniform way. If someone needs to replace the print function with some
    other action, it can be done with a universal search and replace, rather
    than rewriting each print statement by hand."

    Even easier, print as a function can be replaced simply by defining a
    new version with the same name. No search/replace is needed. And
    reversion to the built-in only requires commenting out the replacement.

  • Aahz

    #2
    Re: Linux.com: Python 3 makes a big break

    In article <mailman.2632.1 224358241.3487. python-list@python.org >,
    Terry Reedy <tjreedy@udel.e duwrote:Although I have no objections to the way I was quoted, the article didn't
    include the points I wanted to make. Here's my original interview:

    On Sat, Oct 04, 2008, joabjack@comcas t.net wrote:
    >
    Terrific! Thanks for participating. I'll be sure to put a link in the
    story to your book.
    That would be great! Please use http://www.pythonfood.com/
    Could you say approximately how much Python 2.3 or 2.4 code you have
    in your current job? What is this code used for, broadly speaking?
    The company I work for is http://www.pagedna.com/ -- it has been in
    business for more than ten years and was started with Python 1.4. I've
    been working there for more than four years. Our software is a web
    application for taking orders and sending EPS/PDF files to printing
    plants.

    There's more than 200K lines of code, most of it Python. A lot of the
    code resides in template files for generating web pages. (There's a
    significant amount of JavaScript, much of which is generated by Python
    code.) Although EPS/PDF generation is the heart of our application,
    there are many ancillary features to meet our customer needs (such as
    approval workflow, inventory management, and reporting).
    What are your thoughts about eventually moving that code to 3.0? Would
    this be a big job? At what point, if ever, would it be necessary?
    It would be a huge job, made more difficult because many of our bits of
    Python code reside in web templates. However, by the time we do the
    conversion the tools for automatic conversion should be much improved.
    Although both my boss (Tony Lownds) and I are active in the Python
    community, we haven't even talked about 3.0 -- it's at least two or
    three years away.
    In your opinion, do you think it's a wise move to forgo backward
    compatibility in Python 3.0, given both the user base and current
    limitations of the language?
    First of all, I think it overstates the case to talk about "forgoing
    compatibility". The base Python language is still the same; the only
    difference immediately apparent at the simple scripting level is that the
    print command has changed to a function. Python 3.0 is more about
    removing mistakes and warts, many of which people have been encouraged to
    avoid for years.

    In addition, it is the intention to gradually merge the 2.x and 3.x
    series; Python 2.6 is already a major step in that direction.

    All in all, I think Python 3.0 is the kind of necessary evolution that
    software needs. It certainly isn't as big a change as going from DOS to
    Windows or from Mac OS 9 to OS X.
    What qualities about Python first attracted you to the language?
    Actually, I was forced to learn Python. I was a Perl expert at the time,
    and I saw no reason to learn yet another scripting language. Since then,
    I have become enamored of Python's readability and how a typical
    programmer's pseudocode is trivially translated into running Python.
    Of what you read about Python 3.0, what features do you find most
    intriguing?
    The fact that it's getting done at all! For years, Python 3.0 was
    referred to as Python 3000 -- the joke being that it would happen in the
    year 3000 (meaning, never). Work only started seriously three years ago,
    and I think that Python 3.0 has done an excellent job of balancing the
    past and the future.
    That's about it, though if you have any other thoughts about Python
    3.0, I'd love to hear them as well.
    That pretty much covers it, I think.
    --
    Aahz (aahz@pythoncra ft.com) <* http://www.pythoncraft.com/

    import antigravity

    Comment

    • Lawrence D'Oliveiro

      #3
      Re: Linux.com: Python 3 makes a big break

      In message <gddg1l$53n$1@p anix3.panix.com >, Aahz wrote:
      (There's a significant amount of JavaScript, much of which is generated by
      Python code.)
      Been there, done that. Triple backslashes, anybody? :)

      Comment

      • Lawrence D'Oliveiro

        #4
        Re: Linux.com: Python 3 makes a big break

        In message <mailman.2632.1 224358241.3487. python-list@python.org >, Terry
        Reedy wrote:
        "For instance, the print statement got turned into a print function ... "
        Except I never use print in scripts.

        Comment

        • Aahz

          #5
          Re: Linux.com: Python 3 makes a big break

          In article <gddp44$qhe$3@l ust.ihug.co.nz> ,
          Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealandwrote:
          >In message <gddg1l$53n$1@p anix3.panix.com >, Aahz wrote:
          >>
          >(There's a significant amount of JavaScript, much of which is generated by
          >Python code.)
          >
          >Been there, done that. Triple backslashes, anybody? :)
          Why would you need a triple-backslash? Ever used raw strings?
          --
          Aahz (aahz@pythoncra ft.com) <* http://www.pythoncraft.com/

          import antigravity

          Comment

          • Aahz

            #6
            Re: Linux.com: Python 3 makes a big break

            In article <gddp5a$qhe$4@l ust.ihug.co.nz> ,
            Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealandwrote:
            >In message <mailman.2632.1 224358241.3487. python-list@python.org >, Terry
            >Reedy wrote:
            >>
            >"For instance, the print statement got turned into a print function ... "
            >
            >Except I never use print in scripts.
            "What, never?"
            --
            Aahz (aahz@pythoncra ft.com) <* http://www.pythoncraft.com/

            import antigravity

            Comment

            • Lawrence D'Oliveiro

              #7
              Re: Linux.com: Python 3 makes a big break

              In message <gdds2n$qn0$1@p anix3.panix.com >, Aahz wrote:
              In article <gddp5a$qhe$4@l ust.ihug.co.nz> ,
              Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealandwrote:
              >
              >>In message <mailman.2632.1 224358241.3487. python-list@python.org >, Terry
              >>Reedy wrote:
              >>>
              >>"For instance, the print statement got turned into a print function ...
              >>"
              >>
              >>Except I never use print in scripts.
              >
              "What, never?"
              No, never. Not even "hardly ever".

              Comment

              Working...