From: Paul Prescod Date: 2002-01-14T02:25:52+09:00 Subject: Re: Why I think Ruby will eventually be more popular than Python Thomas Gandy wrote: > >... > > Not to say that Ruby is a messy hacker language - it's really quite > clean and concise, very similar to Python really. But Ruby allows you > to do things like change the behavior of built-in types if you like, > for example. Ruby is just more flexible and history shows that > flexibility ultimately wins over purity. I think that your sense of Python's inflexibility derives from not knowing Python. If on a "flexibility" scale, Ruby is 99 out of 100, Python is 98 and Java is about 60. You can override builtin functions, override the import mechanism, change classes at runtime, modify byte code at runtime, lookup local variables from functions that call you (or functions that call THEM), modify the way inheritance works, etc. There are limits to what can be done at runtime in Python, but it is really as far from Pascal-strict as you can get. Here are some references to "dangerous" or radical uses of Python that you might find useful: * http://starship.python.net/crew/da/acquisition/ * http://www.zope.org/Members/pje/Wikis/TransWarp/TransWarpFAQ * http://bytecodehacks.sourceforge.net/ * http://www.python.org/doc/current/lib/module-parser.html * http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52289 * http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/91192 * http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732 * http://www.python.org/2.2/descrintro.html#subclassing Python is surely not perfect. Inflexibile purity is not something that one can fairly accuse it of. Quite the opposite. Python's OO is much more susceptible to the argument that it is impure than that it is inflexible. Paul Prescod