[issue24941] classproperty

2015-08-26 Thread Yury Selivanov

Changes by Yury Selivanov :


--
components: +Interpreter Core
nosy: +yselivanov
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24941] classproperty

2015-08-26 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24941] classproperty

2015-08-26 Thread Thomas Guettler

New submission from Thomas Guettler:

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?

--
messages: 249182
nosy: guettli
priority: normal
severity: normal
status: open
title: classproperty

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com