adambard / adambard/learnxinyminutes-docs
[python/en] wrappers issue
- Ngôn ngữ chính
- Markdown
- Star
- 12.3k
- Fork
- 3.7k
- Merge trung bình
- 13 giờ 10 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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?
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.