Skip to content

zwang123/classproperty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

classproperty

Provide two Python class decorators classproperty and classproperty_support

Installation

Add $(pwd)/.. to the environment variable $PYTHONPATH

Usage

from classproperty import *
@classproperty_support
class Bar(object):
    _bar = 1

    @classproperty
    def bar(cls):
        return cls._bar

    @bar.setter
    def bar(cls, value):
        cls._bar = value

Read classproperty.py for more examples and details

TODO

  • There are some unexpected results when the derived class has a static member with the same name as its base class's static member

Note

This is deprecated since Python 3.9 as @classmethod can now wrap other descriptors such as @property. See the documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages