Guido van Rossum
guido at python.org
Sun Aug 12 21:21:03 CEST 2001
Glyph Lefkowitz <glyph at twistedmatrix.com> writes:
> As I mentioned in my other email, I think that less efficient should be
> the default. _Usually_ you need dynamism, although it would certainly be
> a good thing to have a more efficient way in some cases!
That may be usually for *your* classes :-). Most of *my* classes
don't need this. If the default is static, most users will not have
to change it (if my expectation is right that most classes don't need
to be dynamic), and so most classes will benefit from the speed-up of
static classes. Since classes that need to be dynamic are naturally
discovered during coding or testing (they give errors when trying to
change a class), selectively turning on the dynamics is easy -- and it
requires an explicit decision on the programmer's behalf.
On the other hand, if the default were dynamic (as it is for classic
classes), it will be very tedious to tune an application for speed --
because all classes are dynamic by default, use of dynamicism may have
crept into the design that requires expensive refactoring before a
class can be made static.
Maybe I'll make this a module-global default, like __metaclass__.
Also note that if a base class is dynamic, its subclasses inherit the
dynamic property by default. (You can still derive a static class
from a dynamic base by saying __dynamic__ = 0.)
> > What do you mean by "real reference replacement"?
> I think I meant "wishful thinking about python being more like
> smalltalk" :-)
But there already *is* a Smalltalk. There's no point in trying to
compete for another language's niche.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-list