Un grand événement pour Python: la sortie de la version 3.0: Python 3000, Py3k
Posté par patrick le décembre 5, 2008
voir http://pvergain.wordpress.com/py3k/ pour les mises à jour.
Ca y est:Python 3000 est arrivé !
Bien sûr la version 2.5 qui est installée sur un très grand nombre de systèmes ne va pas être remplacée de sitôt car un grand nombre de frameworks python ne sont pas encore sous Python 3000. La démarche qui est recommandée est de passer par une version 2.6 et ensuite passer sur Py3k.
Voir à ce sujet:
- http://wiki.python.org/moin/PortingToPy3k (‘Since Python 3 introduces some incompatibilities, a porting strategy is needed to be able to run code on Python 3, and to have a single codebase that can be made to work under Python 2 and Python 3 using automatic conversion‘)
- la FAQ 3000.
- http://docs.python.org/3.0/library/2to3.html (‘2to3 is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code. The standard library contains a rich set of fixers that will handle almost all code. 2to3 supporting library lib2to3 is, however, a flexible and generic library, so it is possible to write your own fixers for 2to3. lib2to3 could also be adapted to custom applications in which Python code needs to be edited automatically’)
D’abord un grand bravo à tous les core-développeurs Python qui ont participé à son développement !.
Ci-dessous quelques réactions à la sortie de Python 3000:
- http://www.python.org/download/releases/3.0/ (‘
We are pleased to announce the release of Python 3.0 (final), a new production-ready release, on December 3rd, 2008.
Python 3.0 (a.k.a. “Python 3000” or “Py3k”) is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Also, the standard library has been reorganized in a few prominent places.’)
- http://jeremyhylton.blogspot.com/2008/12/python-3000.html (‘Python 3000 is ready! The official release may not come until tomorrow, but Barry has tagged the source and is preparing the release. We’ve been waiting for this release for almost nine years. The earliest reference I can find is a message from Guido to python-dev in Jan. 2000.’)
- http://sayspy.blogspot.com/2008/12/holy-crap-30-is-done.html (‘As Jeremy Hylton has pointed out, Python 3000 was first discussed nine years ago. When I first started following python-dev back in June 2002, Python 3000 was this somewhat mythical version that pretty much any idea that seemed somewhat reasonable somehow to someone was attached to. To an extent I viewed it as a joke for a while since the Py3K title was tossed about so loosely.’)
- http://regebro.wordpress.com/2008/12/04/python-30-released/ (‘1 minute before midnight according to the website, Python 3.0 was released. Yes, all the incompatibility tests still runs.’)
- http://blog.dscpl.com.au/2008/12/python-30-and-modwsgi.html (‘Now that Python 3.0 has been released, it is probably worth while pointing out that mod_wsgi has been ported to Python 3.0 for quite a while now. It didn’t always work, but that was actually because various versions of the Python 3.0 betas and release candidates managed to break support for sub interpreters. All these issues in Python 3.0 have been fixed now and mod_wsgi appears to be working fine for a basic WSGI test case. Of course, with Python 3.0 being so new and with the internal changes required to mod_wsgi to handle Unicode strings, there are no doubt some gremlins lurking in the mod_wsgi changes still. One can just hope that the WSGI folks out there don’t ignore Python 3.0 for too long and start on porting some stuff to Python 3.0. This will then give me some decent code on which to test out mod_wsgi support for Python 3.0.’)
- http://jessenoller.com/2008/12/04/python-30-some-multiprocessing-info-administrative-notes/ (‘So, first off – unless you’ve lived under a rock for the last 24 hours, you should know Python 3000 final is hot off the bit presses. This marks a huge milestone for the language, and major props are deserved to all of the python-core people who have spent so much time working on it.
Python 3000 marks an interesting point in the evolution of the language – we all know it is meant to clean up some of the warts of the python 2.x series. It’s designed and implemented knowing full well it breaks backwards compatibility – but I would argue it doesn’t fall in the black and white camp of revolution vs. evolution. In my mind, Python 3 actually falls right in the middle. Yes, it is revolutionary in the aspect that it breaks compatibility with 2, but it is not so significant a series of breakages that it falls outside of the evolutionary camp.’)
- http://plnews.org/posts/python_30_final_released_20081203_210004.html (‘Python 3.0 final has been released. Python is a portable, dynamic, object-oriented language. The new features are described in the “What’s New in Python 3.0” document. This release includes: the replacement of the print statement with the print() function, simplified rules for ordering comparisons, a new form for octal literals, binary literals, a single Unicode string type, function argument and return value annotations, the ‘nonlocal’ statement, a new ‘raise’ statement syntax, new reserved words, a new metaclass syntax, library updates, a new system for string formatting, new and removed builtins, changes to the C API, and other changes.’)
- http://holdenweb.blogspot.com/2008/12/python-30-is-out.html (‘I posted a short article a while ago about 3.0 (in)compatibility, but the differences between 2.6 and 3.0 aren’t so great. It’s perfectly possible to write 3.0 code that will run on 2.6 too, as most of the language hasn’t changed at all.
The preferred strategy for writing code that runs on both versions is to write in 2.6 and then apply the 2to3 converter and verify that it produces a correct 3.0 program. There’s no guarantee that it will, so you may need to paraphrase the 2.6 code a few times before you get a transatable program.
Once all the third-party modules you and extensions you rely on are 3.0-ready, and you no longer have clients requiring 2.6 version of your software, you can simply drop the 2.6 compatibility requirement and start to make use of the few 3.0-only constructs that have been introduced.’)
- http://rhodesmill.org/brandon/2008/comprehension-consistency-at-last-in-python-30/ (‘A new era is begun: Python 3.0 has been released, bringing the bright and burning lights of reason, consistency, and symmetry to bear on my favorite language. Guido van Rossum, the creator of Python, has carefully guided this final attempt to remove the warts that have accumulated over the language’s 17-year lifetime, and the result is magical.
Python 3.0 (r30:67503, Dec 4 2008, 10:23:44)
[GCC 4.3.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>>
>>> [ n*n for n in range(5) ]
[0, 1, 4, 9, 16]
>>>
>>> { n*n for n in range(5) }
{0, 1, 4, 16, 9}
>>>
>>> { n: n*n for n in range(5) }
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16}
... After the aching and painful years of the Python 2 series, the language
once again shines bright and clear as a model of clever symmetries and
low mental impedance. Python’s famously tight “feature set” can, now
more easily than ever, fit comfortably into the programmer’s brain.')
Autres liens
- http://www.python.org/ftp/python/3.0/Python-3.0.tar.bz2
- http://www.python.org/download/releases/2.6.1/
- http://wiki.python.org/moin/Early2to3Migrations
-
http://mail.python.org/mailman/listinfo/python-porting ('This list is to contain discussion of porting Python code between versions,mainly from Python 2.x to 3.x.')
- http://www.comp.leeds.ac.uk/nde/papers/teachpy3.html (‘In this paper, we explore some of the ways in which Python 3.0 improves on earlier versions of the language for the purpose of teaching programming. We highlight simplification of the type system and object model as improvements of particular significance, along with changes to some of Python’s operators and its built-in capabilities for console I/O. We also examine what adopters will need to do to make existing code examples run with Python 3.0, and discuss other obstacles to early adoption such as the lack of suitable of textbooks and delays in introducing support for Python 3.0 into third-party tools and frameworks.’)
- http://mail.python.org/pipermail/python-dev/2008-December/083920.html
- Programming Language :: Python :: 2
- Programming Language :: Python :: 2.3
- Programming Language :: Python :: 2.4
- Programming Language :: Python :: 2.5
- Programming Language :: Python :: 2.6
- Programming Language :: Python :: 2.7
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.0
- Programming Language :: Python :: 3.1



