This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author guettli
Recipients guettli
Date 2015-08-26.07:07:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440572823.94.0.53142388883.issue24941@psf.upfronthosting.co.za>
In-reply-to
Content
Quoting Guido van Rossum Aug 20 2015. Thread "Properties for classes possible?"

https://mail.python.org/pipermail/python-ideas/2015-August/035354.html

{{{
 think it's reasonable to propose @classproperty as a patch to CPython. It
needs to be C code. Not sure about the writable version. The lazy=True part
is not appropriate for th he stdlib (it's just a memoize pattern).
}}}

The solution I use at the moment:

{{{
# From http://stackoverflow.com/a/5192374/633961
class classproperty(object):
    def __init__(self, f):
        self.f = f
    def __get__(self, obj, owner):
        return self.f(owner)
}}}

According to Terry Jan Reedy the next step is to find
someone to translate this to C.

Sorry, my C knowledge is limited. Can anybody help?
History
Date User Action Args
2015-08-26 07:07:04guettlisetrecipients: + guettli
2015-08-26 07:07:03guettlisetmessageid: <1440572823.94.0.53142388883.issue24941@psf.upfronthosting.co.za>
2015-08-26 07:07:03guettlilinkissue24941 messages
2015-08-26 07:07:03guettlicreate