clsprop-1.0.1
توضیحات
🏫 Just like @property but for classes 🏫
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | clsprop-1.0.1 |
| نام | clsprop |
| نسخه کتابخانه | 1.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Tom Ritchford |
| ایمیل نویسنده | tom@swirly.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/clsprop/ |
| مجوز | MIT |
Works just like @property for classes, except deleters don't work (and are
perhaps impossible).
Inspired by https://stackoverflow.com/a/39542816/43839
## Example
import clsprop
class Full:
_name = 'fool'
@clsprop
def name(cls):
return cls._name
@name.setter
def name(cls, name):
cls._name = name
# Unfortunately, the deleter never gets called
@name.deleter
def name(cls, name):
raise ValueError('Cannot delete name')
assert Full.name == 'fool'
Full.name = 'foll'
assert Full.name == 'foll'
del Full.name # oh, well
### [API Documentation](https://rec.github.io/clsprop#clsprop--api-documentation)
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl clsprop-1.0.1:
pip install clsprop-1.0.1.whl
نصب پکیج tar.gz clsprop-1.0.1:
pip install clsprop-1.0.1.tar.gz