Does Python really follow its philosophy of "Readability counts"?
Luis Zarrabeitia
kyrie at uh.cu
Wed Jan 14 10:48:30 EST 2009
On Wednesday 14 January 2009 02:22:45 am Paul Rubin wrote:
> 2. There is also nothing inherent in a dynamic OO language that says
> that class descriptors have to be mutable, any more than strings have
> to be mutable (Python has immutable strings). I agree that being able
> to modify class descriptors at runtime is sometimes very useful. The
> feature shouldn't be eliminated from Python or else it wouldn't be
> Python any more. But those occasions are rare enough that having to
> enable the feature by saying (e.g.) "@dynamic" before the class
> definition doesn't seem like a problem, both for encapsulation
Why don't you do it backwards?
You *can* implement a metaclass that will remove the dynasmism from its
instances. Do it - I can give you a starting point if you wish.
But most of us are very happy with the dynamic nature of python... I chose
python _because_ of it.
> and because it can also improve performance.
Btw, for performance, there is __slots__, with the side-effect that it forbids
attribute creation 'on the fly'.
--
Luis Zarrabeitia (aka Kyrie)
Fac. de Matemática y Computación, UH.
http://profesores.matcom.uh.cu/~kyrie
More information about the Python-list
mailing list