Does Python really follow its philosophy of "Readability counts"?

Mark Wooding mdw at distorted.org.uk
Tue Jan 27 15:13:17 EST 2009


[No, my email address doesn't begin `m...@'.  Fixed.]

Michele Simionato <michele.simionato at gmail.com> writes:

> On Jan 21, 2:11 am, Mark Wooding <mdw at distorted.org.uk> wrote:
>
>> CLOS is much more complex and dynamic than Python's object system;
>> but it can be compiled very aggressively.
>
> I agree that CLOS is complex and that it can be compiled very
> aggressively, but I do not think that it is more dynamic than Python.
> What feature are you alluding to? Multimethods? There are many Python
> implementations of them, they are just not in the standard library.
> Or are you referring to interactive facilities, such as the one
> discussed in this recipe http://code.activestate.com/recipes/160164 ?

I'm referring to a number of features:

  * Redefinition of classes, yes.  Interactive development is very
    frustrating without this.  Thanks for that link, by the way!

  * CHANGE-CLASS to change the class of instances.  This is more than
    just assigning to mumble.__class__, since it correctly initializes
    the slots present in the new class which were absent in the old.

  * And all of the fancy MOP tricks you can play: inventing new slot
    classes; messing with class-precedence-list orderings (Python's
    MRO).

It's a shorter list than I'd hoped!  Still, these features kind of
multiply up.  You can redefine a class using a new metaclass and slot
options, and all the instances are updated, for example.

Anyway, I think I exaggerated when I said that CLOS was `much more
dynamic', but it is /somewhat/ more dynamic, and still amenable to
optimization; since my point was that dynamism in a language isn't
necessarily antithetical to compilation, that's still sufficient.

Thanks for keeping me honest!

-- [mdw]



More information about the Python-list mailing list