On Thu, Jan 29, 2015 at 12:16 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > Besides, descriptors are > handled by the metaclass, so we could write a metaclass that doesn't handle > them.
Maybe this doesn't affect your argument, but they're actually handled by the class's __getattribute__, not by the metaclass. >>> class MyMeta(type): ... def __getattribute__(cls, attr): ... raise AttributeError(attr) ... >>> class MyClass(metaclass=MyMeta): ... @property ... def spam(self): ... return 42 ... >>> MyClass().spam 42 >>> class MyClass: ... def __getattribute__(self, attr): ... return type(self).__dict__[attr] ... @property ... def spam(self): ... return 42 ... >>> MyClass().spam <property object at 0x7f0603e70598> -- https://mail.python.org/mailman/listinfo/python-list