Keith Devens .com |
Saturday, May 17, 2008 | ![]() |
| We ought always to deal justly, not only with those who are just to us, but likewise to those who... – Hierocles | ||
|
| ← Spider solitaire | MetaC → |

DJ Hannibal wrote:
Hans (http://zephyrfalcon.org/) wrote:
With a prototype-based object system the distinction between metaclasses and classes (heck, and objects) goes away, so it seems to me that you could do the same thing as what Python calls metaclasses simply by overriding a particular object's clone method. Am I wrong?
No, IMHO, with a prototype-based system, a whole slew of problems and unnecessary features of class-based languages just disappears. Since there is no distinction between classes and instances anymore, there's no need for metaclasses, classes, or class methods.
It's more or less possible to write a prototype-based system in Python (ala Self), by the way... but it would be clumsy to use. Been there, done that. :-)
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.347s.
(Used 8 db queries)
"Chapter 20. Descriptors, Decorators, and Metaclasses" in "Python Cookbook, 2nd Edition" is really good. (It is on my Safari bookshelf if you want to take a look.)