anatoly-scherbakov / anatoly-scherbakov/documented
Implement @documented decorator for functions
未關閉
- 主要語言
- Python
- 星號
- 16
- 分支
- 0
- PR 合併指標
- 30 天內沒有已合併 PR
描述
```python
@documented
def calculate_customers_report(customers: List[Customer], requested_by: User) -> CustomerReport:
"""
Build customers report.
Requested by: {requested_by}.
"""
```
When this function is executed, the following message can be printed:
```
Build customers report.
Requested by: John Doe.
```
Before executing the function, its wrapper will substitute the arguments of the function call into the docstring and then will print the docstring using built-in Python logging system.
Purpose of this is to illustrate what is happening in the program in a human readable way in its log.
貢獻指南
評估
這個 Issue 還沒有評估資料。