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

[ENH] Explain effect of binding=False on @functools.wraps(f) in the documentation of compiler directives #6557

Open
user202729 opened this issue Dec 9, 2024 · 3 comments

Comments

@user202729
Copy link

Is your feature request related to a problem? Please describe.

That binding=True is required for functools.wraps to work. Context: #6555

Describe the solution you'd like.

No response

Describe alternatives you've considered.

No response

Additional context

No response

@user202729 user202729 changed the title [ENH] Explain effect of binding=False on @functools.wraps(f) [ENH] Explain effect of binding=False on @functools.wraps(f) in the documentation of compiler directives Dec 9, 2024
@da-woods
Copy link
Contributor

I do agree with could improve the documentation for the binding directive - it does leave you a little unclear what it's actually for.

I'm reluctant to start listing every individual thing that binding=False disables/breaks. Mainly because there's a lot of them. And because it's not actually deliberately disabling features - it just isn't using our nicer wrapper class. The better way of thinking of it is:

  • binding=True behaves more like a Python function in almost every way,
  • binding=False reduces the code size a little.

@user202729
Copy link
Author

I see, cool.

By the way, does binding=True result in slower function call in general? ( sagemath/sage#26254 says that there is a performance degradation which I assume is what they are mainly concerned about )

@da-woods
Copy link
Contributor

I haven't actually measured it in recent memory. I wouldn't be surprised if it was a little slower, but probably pretty close on versions of Python that support vectorcall.

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

2 participants