[Python-Dev] Classes and Metaclasses in Smalltalk

Guido van Rossum guido@digicool.com
Wed, 02 May 2001 10:23:33 -0500


> > Except that sometimes you really do want x.__class__.__classdict__ to
> > have priority (e.g. for "guarded" attributes).
> 
> What's a "guarded" attribute?

I meant an attribute that's implemented by a pair of get and set
functions.  This is very useful; my proposed design lets you define
this more directly rather than requiring you to override __getattr__
and __setattr__.

> > But the issue of backwards compatibility is a big one here
> 
> I was thinking that, while this is still in the __future__,
> the __dict__ attribute would be a pseudo-dict that, by
> default, behaves like the union of the old __dict__ and
> the __classdict__.

Actually, I think that what's in the __dict__ is just perfect; it's
the definition of getattr(classobject, name) where name is both an
instance and a class method that causes trouble.

--Guido van Rossum (home page: http://www.python.org/~guido/)