abd-0.0.3
توضیحات
Abstract base class for decorators
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | abd-0.0.3 |
| نام | abd |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | wiebe |
| ایمیل نویسنده | wiebe@email.xom |
| آدرس صفحه اصلی | https://github.com/w13b3/abstract_base_decorator |
| آدرس اینترنتی | https://pypi.org/project/abd/ |
| مجوز | Mozilla Public License Version 2.0 |
abd - Abstract Base Decorator
---
abd provides an `AbstractBaseDecorator` class which you can inherit from to create flexible decorators.
## Example
```Python3
>>> from abd import ABD
>>> class Decorator(ABD):
... def invoke(self, *args, **kwargs):
... """Must write an invoke function
... invoke is called when the decorated function is called
... """
... # catch, edit and pass on the (keyword) arguments
... # that are given the the decorated function
... print('invoke is called')
... result = self.decorated_object(*args, **kwargs)
... # function has been called and result is available
... # possible to edit the result here
... return result
...
>>> @Decorator
... def func(argument):
... # some function logic ...
... return argument
...
>>> func('some text')
invoke is called
'some text'
>>>
```
## PyPI
[pip install abd](https://pypi.org/project/abd/ "PyPI abd page")
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.0, <4 | Python |
نحوه نصب
نصب پکیج whl abd-0.0.3:
pip install abd-0.0.3.whl
نصب پکیج tar.gz abd-0.0.3:
pip install abd-0.0.3.tar.gz