gabriele renzi <surrender_it / remove.yahoo.it> wrote in message news:<t9b6001rep3cjtlg1a8gmodhfk3f256iof / 4ax.com>...
> il 12 Jan 2004 22:27:13 GMT, ggarramuno / aol.com (GGarramuno) ha
> scritto::
> 
> 
> 
> >Python2.2's numbers are now also objects and thus it also has to check if it
> >has to do the same type of dispatching that Ruby does, yet its speed is much,
> >much closer to Perl's.
> 
> still, you can't reopen base classes in python, IIRC..

No, you can't, but you can now inherit from them and create your own
subclass and any function that uses the base class (say ints) can take
your new class type, too.
To be honest, I see this as a better approach.  You get the speed
benefit and safety, too.
I am still not 100% convinced that Ruby's feature of reopening base
classes is truly a benefit.  I see it as a long string of rope for
hanging yourself in the long run, perhaps.
I mean, for my own personal code, I see the ability to extend base
classes as a great benefit.  I know in a year or so I would easily
have a String, Fixnum, etc. classes with tons of new things in them.
But so would most ruby users, I assume.  I fret at the prospect of one
day trying to integrate two libraries or two pieces of code that have
an extended base class with similar named functions that do completely
different things.
But then again, I am quite new to Ruby.  I am sure this issue might
have already arised, and there may be a workaround for it?
Can extensions to base classes be kept within a specific namespace
only?