Austin Ziegler
11/30/2004 6:37:00 PM
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.
> (ruby does/has) 4 PEP 292: Simpler String Substitutions
This is just bizarre as something to put into Core Python; however,
given that Ruby ships with RDoc, which gives you the RDoc templating
engine, you have something like this already.
> (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 :)
> (dont know) 7 PEP 324: New subprocess Module
This basically introduces popen.
> (ruby dont have) 8 PEP 327: Decimal Data Type
I think that BigDecimal handles this just fine. Note as well that
with the Rational class (require 'rational'), you get support for
real rational numbers. If you add 'mathn', you get full support
including with division, etc.
require 'rational'
Rational.reduce(22, 7) # => Rational(22, 7)
require 'mathn'
"%0.9f" % [ 22 / 7 ] # => "3.142857143"
(22 / 7).class # => Rational
BigDecimal works with Numerics, BigIntegers, and Floats, I think.
> (dont know) 9 PEP 328: Multi-line Imports
Not needed.
> (dont know) 10 PEP 331: Locale-Independent Float/String Conversions
I don't think that this is needed.
-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca