Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python/en] wrappers issue #4870

Open
annakz1 opened this issue Mar 31, 2024 · 0 comments
Open

[python/en] wrappers issue #4870

annakz1 opened this issue Mar 31, 2024 · 0 comments

Comments

@annakz1
Copy link

annakz1 commented Mar 31, 2024

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant