Slashdot Mirror


Python 3.3.0 Released

An anonymous reader writes "After just over a month of release candidates, the final version of Python 3.3 launched today. This version includes new syntax, including the yield from expression for generator delegation; new library modules, including fault handler (for debugging crashes), ipaddress, and lzma (for data compression using the XZ/LZMA algorithm); a reworked OS and I/O exception hierarchy; the venv module for programmatic access to Python virtual environments; and a host of API changes. The full list of features and the change log are both available."

5 of 131 comments (clear)

  1. Re:Python 3 and its use by Zamphatta · · Score: 5, Informative

    In mid-August, Django had a blog post 'Experimental Python 3 Support' (https://www.djangoproject.com/weblog/2012/aug/19/experimental-python-3-support/), which talked about the progress they've made so far towards porting the system to Python 3 and how it's coming along well. It's to be considered pre-alpha at the moment, but there's been a lot of progress over this summer.

  2. Re:Python 3 and its use by buchner.johannes · · Score: 4, Informative

    Killing Python 2 is going to be like killing IE6 and Windows XP - a noble goal that turns out to take decades. And it's a totally self-inflicted wound by the Python community.

    Except nobody intends to kill Python 2 anytime soon. When Python 3 was shaped, it was everyones plan to have Python 2 + 3 alongside for a long time.

    --
    NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
  3. Re:Python 3 and its use by csumpi · · Score: 5, Informative

    That might be the case, except:

    #!/bin/env python

    might give you python2 or python3. And there's no standardized way to ask for python2 or python3.

  4. Re:Python 3 and its use by lattyware · · Score: 5, Informative
    You say that, PEP 394 -- The "python" Command on Unix-Like Systems clearly defines this:

    This PEP provides a convention to ensure that Python scripts can continue to be portable across *nix systems, regardless of the default version of the Python interpreter (i.e. the version invoked by the python command).

    • python2 will refer to some version of Python 2.x
    • python3 will refer to some version of Python 3.x
    • python should refer to the same target as python2 but may refer to python3 on some bleeding edge distributions

    Pretty clear and standardised to me.

    --
    -- Lattyware (www.lattyware.co.uk)
  5. One other new feature by shutdown+-p+now · · Score: 4, Informative

    It's a part of PEP 380, which is mostly about "yield from", but this little gem actually matters elsewhere. You can now return values from iterators. I.e.:

    def foo():
      yield 1
      yield 2
      return 3

    Since return from an iterator just raises StopIteration exception, they've added a field to propagate the value. Previously you could only use the no-argument return.

    Why this matters is because it gives you the final bit needed to provide full syntactic sugar to write asynchronous functions (task-based, chained callback model - think Node.js, or Twisted in Python land) as if they were synchronous, except that you use "yield" at the points where you want to cooperatively yield control. Of course yield is the bigger part of it anyway, and it was there before, but you had to use some magic function call to implement final return. Now it really looks exactly like a synchronous function, except for "yield".