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

Original function's signature overwrite #5

Open
roo-oliv opened this issue Mar 6, 2018 · 0 comments
Open

Original function's signature overwrite #5

roo-oliv opened this issue Mar 6, 2018 · 0 comments
Labels
enhancement New feature or request under evaluation This request in under evaluation

Comments

@roo-oliv
Copy link
Owner

roo-oliv commented Mar 6, 2018

When a function decorated with @autowired is inspected to get it's signature the original function's signature with required kwargs should be overwritten by a signature exposing injectables as optional kwargs.

import inspect

@autowired
def foo(a: Autowired("A")):
    print(a)

inspect.signature(foo)
# <Signature (a: <injectable.autowiring.autowired_type._Autowired object at 0x7ff88eea53a0>)>

@autowired not overwriting the original signature may cause checks of uses vs signature to fail.

@roo-oliv roo-oliv added enhancement New feature or request under evaluation This request in under evaluation labels Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request under evaluation This request in under evaluation
Projects
None yet
Development

No branches or pull requests

1 participant