UserLinux chooses Python as "interpretive language" of choice

John Roth newsgroups at jhrothjr.com
Tue Dec 23 07:02:23 EST 2003


"Francis Avila" <francisgavila at yahoo.com> wrote in message
news:vufdk79q4g4i8a at corp.supernews.com...
>
> Of course, the typical Ruby accusation against Python is that it (Ruby) is
> "purer OO".  I don't know what they mean by "purer".

I suspect they are objecting to the use of built-in functions, and
the use of functions in modules. Ruby
uses methods for everything, and everything inherits from a base
object that has a huge number of methods. Python is simply not
going to go down that path. Personally, I don't have any opinion
about which is better, both styles work.

The other possibility is the pervasive use of the visitor pattern
rather than Python's use of for statements for iterations. This,
combined with the ease of creating anonymous functions, does
seem to make a significant difference - at least it's what most
Ruby afficianados talk about when they say what they like about
the language.

> If they mean the
> fundamental types not being subclassable, that's an old wart that's very
> nearly gone.  Otherwise, I don't know what they could possibly mean,
> considering absolutely everything in Python is an objects upon objects
upon
> objects.  A class is an object, the methods of an instantiated class are
> objects, the function a method wraps is an objects, the code of the
function
> is an object....  I think about the only thing that is not an object in
> Python is a name, and I can't think how *that* would work.

Interesting question, especially since it does seem to come up
every few months.

Technically, since names are simply keys in dictionaries, they
*are* objects. I think the descriptor facility is a start on
addressing that question, though.

Rather than asking how it would work (the obvious answer
is a different dictionary implementation for use in objects)
it might be better to ask what you would use it for.

John Roth
>
> --
> Francis Avila
>






More information about the Python-list mailing list