[Python-Dev] Classes and Metaclasses in Smalltalk (original) (raw)

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/)