[Tutor] classproperty, three times in virtualenv

Thomas Güttler guettliml at thomas-guettler.de
Thu Apr 20 04:37:53 EDT 2017



Am 19.04.2017 um 09:43 schrieb Alan Gauld via Tutor:
> On 19/04/17 08:28, Thomas Güttler wrote:
>
>> Nice, if it is that simple.
>>
>> Is there a reason why this is not in the standard library?
>
> Probably because it is such a rare use case and because
> its not that hard to do yourself if you really need it.
>
> But the standard library, like any open source project,
> develops as people need things. If nobody needs something
> it will never be built and therefore never be added to
> the library. I'd guess this falls into that category.

In my virtualenv it looks like it has three implementations. Maybe more with a different name.

user at host> find src/ lib/ -name '*.py'|xargs grep -Ei '(def|class) classproperty'

lib/python2.7/site-packages/logilab/common/decorators.py:class classproperty(object):
lib/python2.7/site-packages/django/utils/decorators.py:class classproperty(object):
lib/python2.7/site-packages/mptt/models.py:class classpropertytype(property):



Regards,
   Thomas


-- 
Thomas Guettler http://www.thomas-guettler.de/


More information about the Tutor mailing list