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

Signature Changing Decorators issue #232

Open
subsurfaceiodev opened this issue Mar 10, 2023 · 1 comment
Open

Signature Changing Decorators issue #232

subsurfaceiodev opened this issue Mar 10, 2023 · 1 comment

Comments

@subsurfaceiodev
Copy link

Hey there! First of all, thanks for this wonderful package. We are currently facing an issue when dealing with "Signature Changing Decorators" functionality,

Currently, wrapt allows you to change wrapped function's signature via the argspec_factory adapter and it works. The question is, how can you send current args / kwargs to this argspec_factory adapter so you can change the function´s signature depending on the value(s) of current args / kwargs. So, for example, if user gives input "consider_port_is_present" = False, then we could change wrapped function's signature depending on that value (e.g. adding "port" argument to argspec only if consider_port_is_present is True).

@GrahamDumpleton
Copy link
Owner

Can you show any rough code you have now? I don't need the full body of your decorator, but do need to see how using argspec_factory now and whether you are creating a decorator which takes arguments. If not creating a decorator with arguments I don't understand where consider_port_is_present argument is being supplied.

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