adambard / adambard/learnxinyminutes-docs

[python/en] wrappers issue

Ouverte
#4,870 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Markdown
Étoiles
12.3k
Forks
3.7k
Merge moyen
13 h 10 min
PR mergées (30 j)
6

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.