adambard / adambard/learnxinyminutes-docs
[python/en] wrappers issue
- 主要言語
- Markdown
- スター
- 12.3k
- フォーク
- 3.7k
- 平均マージ
- 13時間 10分
- マージ済み PR(30日)
- 6
説明
I saw 2 issues in the '7. Advanced' section:
1. In the "log_function" wrapper I don't see the '3' printed as explained:
`my_function(1,2) # => "Entering function my_function"`
` # => "3" `
` # => "Exiting function my_function"`
For the '3' to be printed I needed to add `print(result)` inside the `log_function`- I would suggest adding it.
2. The last line in the article didn't work for me- `print(my_function.__code__.co_argcount) # => ` prints 0 instead of 2 as expected. I see in debugger that `co_argcount` inside the wrapper function=2, but it prints 0 for `print(my_function.__code__.co_argcount)`.
Could it be that `co_argcount` is not supported in the functools @wraps?
コントリビューションガイド
評価
この issue はまだ評価されていません。