Python 2.4 released
p2pnet.net News:- The final, stable release of the Python programming language is now online.
Python 2.4 the result of almost 18 month’s worth of work on top of Python 2.3 and represents another stage in the careful evolution of Python.
“New language features have been kept to a minimum, many bugs have been fixed and a variety of improvements have been made,” says the download site.
What’s new in Python 2.4? It’s faster and, says the Python, a number of modules that were added in Python 2.3 (such as sets and heapq) have been recoded in C. In addition, there’s been a number of other speedups to the interpreter.
New language features
- multi-line imports – when using imports in the form from foo import bar, baz, bing, bang, you can surround the imported names with brackets, and they can be split across lines. This is part of PEP 328.
- Farewell to OverflowWarning – as documented in PEP 237, Python no longer generates OverflowWarnings.
- function/method decorators – function and method decorators, first described in PEP 318, have been added to the language, using ‘pie-decorator’ syntax. Decorators are on the line before the ‘def’, and prefixed with an ‘@’ sign. (PEP 318)
- Assigning to None – the compiler now treats assigning to None as a SyntaxError.
- Failed import cleanup – when a module import failed, versions of Python prior to 2.4a2 would leave a broken module in sys.modules – subsequent attempts to import the failing module would silently succeed, but use the broken module object. The import machinery now removes the failing module from sys.modules if the import fails.
- The -m command line option – python -m modulename will find a module in the standard library, and invoke it. For example, python -m pdb is equivalent to python -m /usr/lib/python2.4/pdb.py
New or upgraded built-ins
- built-in sets – the sets module, introduced in 2.3, has now been implemented in C, and the set and frozenset types are available as built-in types (PEP 218)
- unification of integers and long integers – an operation that would return a number too big for an integer will automatically return a long integer. (PEP 237)
- generator expressions – generator expressions are similar to a list comprehension, but instead of creating the entire list of results they create a generator that returns the results one by one. This allows for efficient handling of very large lists. (PEP 289)
- reversed() – a new builtin that takes a sequence and returns an iterator that loops over the elements of the sequence in reverse order (PEP 322)
- decimal – a new numeric type that allows for the accurate representation of floating point numbers (avoiding the problems of binary floating point) (PEP 327)
- new sort() keyword arguments – sort() now accepts keyword arguments cmp, key and reverse
- sorted() – a new builtin sorted() acts like an in-place list.sort() but can be used in expressions, as it returns a copy of the sequence, sorted.
- string methods – strings gained an rsplit() method, and the string methods ljust(), rjust() and center() accept an argument to specify the fill character.
- eval() now accepts any form of object that acts as a mapping as its argument for locals, rather than only accepting a dictionary. There’s all sorts of new and shiny evil possible thanks to this little change.
If you’re looking for a detailed What’s New breakdown, go here.
===================
See:-
evolution of Python - Python 2.4, November 30, 2004





December 1st, 2004 at 7:13 am
Yay! Pythonic goodness!
Now all I need is compiled modules for win32…
Either that or modules that compile under win98 with mingw…
Maybe Wine under Gentoo already emulates win98 sufficiently…
Getting off topic here.
Python 2.4 in debian stable would be fun too.
All in good time…
And now, to bring p2p into this comment I bring to your attention:
http://www.twistedmatrix.com/
Twisted is a framework, written in Python, for writing networked applications.
Want to write your own p2p app?
Python is super easy to learn, powerful and portable!
For further information you can look at the Language Comparison page:
http://www.python.org/moin/LanguageComparisons