Eric Snow added the comment:
It does not necessarily require a metaclass. You can accomplish it using a
custom descriptor:
class classattr:
def __init__(self, getter):
self.getter = getter
def __get__(self, obj, cls):
return self.getter(cls)
FWIW, this is a descriptor that may be worth adding somewhere regardless.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19640>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com