Is classless worth consideration

Hung Jung Lu hungjunglu at yahoo.com
Fri Apr 30 14:17:59 EDT 2004


Peter Hansen <peter at engcorp.com> wrote in message news:<84Kdnfu3OoN4oA_dRVn-vg at powergate.ca>...
> Hung Jung Lu wrote:
> > I have also pointed out previously that
> > Python uses 5 devices where prototype-based needs only one: (a) class,
> > (b) instance, (c) module, (d) metaclass, (e) scope. If this is not
> > hideously baroque, then, Houston, we've got a problem. If you can
> > really think outside the box, you'd pitch in also: (f) aspect.
> 
> Well, (c) module is merely a packaging technique, not anything
> to do specifically with OOP, so it shouldn't appear in a list
> of "what do you think makes Python's OO model hideously baroque".

Are you sure about that? Have you seen how people put an class
instance in sys.modules so they could use it as a module (an old trick
by now)? Have you seen people asking __call__() to make modules
callable, and/or property getters/setters for modules? "Merely a
packaging technique"? Have you seen people using modules as
singletons? Do you realize that "from ... import ..." is nothing but a
form of module inheritance? Think again. Let me say it again: think
outside the box. It's hard to do when you are inside the box. But try.
Try hard.

> Scope doesn't quite seem to fit in this either, but not
> being a theoretician I'll just leave the discussion at
> this point 

I am sorry, there is no theory to do here. Check out the Io language.

Code factorization is carried out not when two pieces of code are
identical, but when they are analogous enough. By tearing things apart
and claiming that they are different and should not be unified, it
only goes to show you are still inside a box. All the 6 devices I have
pointed out can be reduced to one single device: object. Matter of
fact, many of them are already unified in a prototype-based language
like Io, no theory there. Why have 6 devices and all kinds of
redundancies/inconsistencies/hacks, when you can do it all with just
one? As the other poster said: "hideously baroque" it is.

regards,

Hung Jung



More information about the Python-list mailing list