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

using partial(f) to create a "copy" is not equivalent to wraps(f)(f) #73

Closed
smarie opened this issue Oct 6, 2021 · 3 comments
Closed

Comments

@smarie
Copy link
Owner

smarie commented Oct 6, 2021

No description provided.

@smarie smarie changed the title using partial(f) to create a copy does not work ? (to check) using partial(f) to create a "copy" does not work as with functools.partial ? (to check) Oct 6, 2021
@smarie
Copy link
Owner Author

smarie commented Oct 8, 2021

Actually it does work, but it does not preserve the link to the original function, since @wraps is called with a new signature, while it does not actually change.

@smarie
Copy link
Owner Author

smarie commented Oct 8, 2021

I'll just fix this tiny consistency bit, but if we want a "function copy" API we should rather provide an explicit copy_fun(f, deep=False) api

@smarie smarie changed the title using partial(f) to create a "copy" does not work as with functools.partial ? (to check) using partial(f) to create a "copy" is not equivalent to wraps(f)(f) Oct 8, 2021
@smarie
Copy link
Owner Author

smarie commented Oct 8, 2021

I opened #74 for the more general discussion

@smarie smarie closed this as completed in 6191e02 Oct 8, 2021
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