anatoly-scherbakov / anatoly-scherbakov/documented

Implement @documented decorator for functions

未關閉
#4 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
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 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。