caller-0.0.2
توضیحات
Set a Python property using a function call
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | caller-0.0.2 |
| نام | caller |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Victor Titor |
| ایمیل نویسنده | vtitor.edumix@gmail.com |
| آدرس صفحه اصلی | https://github.com/vtitor/caller |
| آدرس اینترنتی | https://pypi.org/project/caller/ |
| مجوز | - |
# caller
[](https://travis-ci.org/vtitor/caller)
[](https://github.com/ambv/black)
Caller is a little library for calling a property as a regular function.
Installation
------------
Install using pip:
$ pip install caller
Usage
-----
```python
from caller import property
class Foo(object):
def __init__(self, bar):
self._bar = bar
@property
def bar(self):
return self._bar
@bar.setter
def bar(self, new_bar):
self._bar = new_bar
foo = Foo('bar')
foo.bar('new bar')
print(foo.bar)
```
Prints
```
new bar
```
Or with a separate caller
```python
class Foo(object):
...
@bar.caller
def bar(self, new_bar):
self._bar = new_bar[::-1]
print(self._bar)
Foo('bar').bar('new bar')
```
Prints
```
rab wen
```
That's all.
نحوه نصب
نصب پکیج whl caller-0.0.2:
pip install caller-0.0.2.whl
نصب پکیج tar.gz caller-0.0.2:
pip install caller-0.0.2.tar.gz