Python 2.4 release candidate 1 is out.
As usual, Andy Kuchling's What's New in Python document is the best place to start. Highlights for me are Generator Expressions and the Decimal Data Type. I've blogged about the first of these before - see my Generator Expressions post. And I've mentioned the need for a decimal type before, too. Great stuff.
Congratulations and thanks to Guido and the Python-dev team.
As to the controversial Decorators for Functions and Methods, the jury's still out. The syntax still looks a little odd to me, but the same could have been said of the syntax for Slicing and List Comprehensions at first, to name but two things. Time has taught me that these syntaxes are actually really good. Guido knows what he's doing. And there's no doubt that decorators can be useful - see Decorator for BindingConstants at compile time and Memoize Decorator with Timeout for examples.
Update November 30th: Python 2.4 final is out.
Posted to Python by Simon Brunning at November 19, 2004 10:19 AMGood grief, Python is just now getting this? Man, you really need to check out Ruby. :)
- Dan
Posted by: Daniel Berger on November 19, 2004 09:04 PMHah! According to RubyFromPython[1], Ruby doesn't even have List Comprehensions, let alone Generator Expressions.
Nor does it appear to have Generators. It *does* have Continuations, which Python doesn't. Continuations are more powerful, but far more complex. You pays your money, you takes your choice.
Bear in mind, I don't know Ruby, so this may all be utter rubbish. Utter rubbish, from me? Who'd ever have guessed. ;-)
[1] http://www.rubygarden.org/ruby?RubyFromPython
Posted by: Simon Brunning on November 22, 2004 12:25 PMFrom reading the PEP on Generator Expressions, I don't see what it does that Ruby's block + yield syntax doesn't do already. I'm also not sure what the differences are between Python's Decimal data type vs. Ruby's Float type. Then again, I've never been great at math. ;)
As for list comprehensions, you can do those easily enough using Range + map. Not as slick as Lisp, but then Ruby (nor Python) are functional programming languages.
As for Generators, the 'generator' library is part of the standard Ruby library as of 1.8.0. But then, I haven't found much need for external iterators myself.
BTW, I meant for my original post to be a bit teasing. I think Python is a fine language. Ruby just fits my brain better. :)
- Dan
Posted by: Daniel Berger on November 22, 2004 03:45 PMDan,
Well, first of all, decimals and floats are *totally* different. See http://www.brunningonline.net/simon/blog/archives/000710.html and http://www.brunningonline.net/simon/blog/archives/000911.html for details. You *need* to know the difference. (Naturally, Python also has has floats for ever.)
Using map and filter (not just map), you can indeed do anything a list comp can do. But map and filter don't fit my brain - list comps do.
I'll take your work for it that Ruby's block and yield can do everything that a Generator Expression can - Generator Expressions are't *very* powerful. It's just that you get a *fair* amount of power from a very simple construct. I like that.
Thanks for commenting, Dan. I certainly didn't feel that you were attacking Python, and I'm always pleased to learn a little more about Ruby. It also sounds like a fine language, albeit one that doesn't appear to offer any great advantage over Python.
And we Python and Ruby fans should stick together. It's those Perl bastards we need to watch out for. ;-)
Posted by: Simon Brunning on November 22, 2004 04:22 PM"Well, first of all, decimals and floats are *totally* different."
Ah, ok. I just checked and Ruby does have a BigDecimal class in the stdlib. I dunno that this is useful for Business Math (for lack of a better term). Maybe I'll port your project. :)
I'm also going to tinker with creating a ListComprehension class for Ruby now to hide some of the clunkiness. :)
- Dan
Posted by: Daniel Berger on November 22, 2004 06:57 PMPython's decimal class is an implementation of of IBM's General Decimal Arithmetic standard[1], and was written by the inestimable Timbot[2]. Writing maths labraries is *hard*, but if anyone can get it right, Tim will.
[1] http://www2.hursley.ibm.com/decimal/
[2] http://www.python.org/tim_one/
zoofilia ro 10 videos - bollyboodsex com - www banat sex com www banat - www yuoporn - www Kobravideos com -
Posted by: balabo3_bc on May 19, 2009 10:57 PMzoofilia ro 10 videos - bollyboodsex com - www banat sex com www banat - www yuoporn - www Kobravideos com -
Posted by: balabo3_bc on May 19, 2009 10:57 PM