Austin Ziegler ha scritto: > On Wed, 1 Dec 2004 02:35:02 +0900, Zach Dennis <zdennis / mktec.com> > wrote: > >>A coworker of mine came and hollarred at me because on /. it >>mentioned that Python 2.4 was released...so I went to check it >>out. >> >>I read the What's new section but isn't the majority of stuff they >>added in 2.4 stuff Ruby already does? > > >>(dont know) 3 PEP 289: Generator Expressions > > > This may be similar to Enumerable#inject. not really. to understand generator expression you first think of list comprehensions: ary=[ f(x) for x in sequence if somecondition on x ] Basically a #map + #select in a single loop (I'd like to have an Enumerable#map_filter, btw) Then think of a lazy version of it (returning a generator) instead of a whole constructed list, so that you can write: function(f(x) for x in seq) instead of function([f(x) for x in seq]) withouth building a whole array when calling the function. Notice that we have generator.rb wich can transform a internal (rubyish) iterator into a lazy generator >>(ruby does/has?)5 PEP 318: Decorators for Functions and Methods > > > Ruby has this implicitly, because its object model is far more > consistent. The only thing that may improve this is an RCR that > makes it easier to deal with custom decorators by having def return > the Symbol of the method name. Probably :) this does not relate to the object model. A common python idiom is always been: class Foo(object): def foo(): ... foo=somedecorator(foo) wich is basically what we do in ruby with: class Foo def foo ... end somedecorator :foo end Btw, I hope matz will accept RCR 277 soon http://rcrchive.net/rcr/show/277 > >>(dont know) 7 PEP 324: New subprocess Module > > > This basically introduces popen. no, they already had popen they just 'refactored' > >>(dont know) 10 PEP 331: Locale-Independent Float/String Conversions > > > I don't think that this is needed. I can't see an use for it, but they have a rational for this, and actually the code is borrowed from GLIb so others seem to think it is useful Just playing devil's advocate :)