{"id":23429,"library":"classproperties","title":"classproperties","description":"A lightweight Python library providing property decorators for classmethods and staticmethods. Version 0.2.0 is the latest release. The project is minimally maintained.","status":"maintenance","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/dpep/pyclassproperties","tags":["classproperty","decorator","python","utility"],"install":[{"cmd":"pip install classproperties","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"No common incorrect import path.","wrong":"","symbol":"classproperty","correct":"from classproperties import classproperty"}],"quickstart":{"code":"from classproperties import classproperty\n\nclass MyClass:\n    @classproperty\n    def my_prop(cls):\n        return 'classprop_val'\n\nprint(MyClass.my_prop)","lang":"python","description":"Basic usage of classproperty decorator."},"warnings":[{"fix":"Ensure the decorated function is a classmethod-like method with 'cls' parameter inside a class.","message":"The decorator must be used inside a class definition and the method must accept 'cls' as its first argument. Defining it outside a class will raise an error.","severity":"gotcha","affected_versions":"all"},{"fix":"Always apply @classproperty explicitly in subclasses that need a different value.","message":"Inheritance may not work as expected if subclasses override the property without using the decorator. The parent class property will be used if overridden as a regular attribute.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Make sure the method signature is like: def method(cls): and that @classproperty is applied inside a class body.","cause":"The decorated method does not accept 'cls' as its first parameter, or the decorator is applied to a non-method.","error":"TypeError: @classproperty can only be used on methods with 'cls' as first argument"},{"fix":"Ensure Python 3. Use only on methods defined inside a class.","cause":"Using an incompatible Python version or applying the decorator incorrectly (e.g., on a non-function). The library may not support Python 2.","error":"AttributeError: 'function' object has no attribute '__get__'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}