|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Python 2.4 Alpha 1 released
The first alpha version of Python 2.4 has been released, so you can try out the new features and help shake out any bugs.
For me the most exciting new feature is generator expressions - these are similar to list substitutions, but create a generator instead of a list. For example, to add up the squares of all the numbers from 1-100 that are divisible by three you can do: Code:
>>> sum( x*x for x in xrange(1, 101) if (x % 3)== 0 ) 112761 The home page for 2.4 is at http://www.python.org/2.4/ An overview of the new features is at http://www.python.org/dev/doc/devel...whatsnew24.html. Dave - The Developers' Coach |
|
#2
|
|||
|
|||
|
I should just re-emphasise that this is an ALPHA release, so do not use it for any production code. It is also likely that more features will be added before beta, and existing new features may change.
Dave - The Developers' Coach |
|
#3
|
||||
|
||||
|
Wow, this release is looking good so far. But gonna have t wait to see what speed increases we'll get
.Particually excited about the new decimal type, since i've been confrunted by the problems of floating point arithmetic in the past, so it seems like a great idea (the PEP page is currently unavailable though ). Totaly in agreement with the generator expressions - definatly the major improvment! Dave, I'm assumng by 'list substitutions' you mean 'list comprehensions' right?So thats my evening planned out for me already! Have fun, Mark. |
|
#4
|
|||
|
|||
|
Quote:
Whoops, yes I did - I am getting befuddled in my old age. Please substitute comprehensions for substitutions for better comprehension. Dave - The Developers' Coach |
|
#5
|
||||
|
||||
|
Ah its not a problem really, i called them list compressions untill Strike pointed it out to me
hehe. And its not like its the easiest name to remember in the world .Mark. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Python 2.4 Alpha 1 released |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|