Add provided()<func>.call *args, **kwargs arguments #945#946
Open
pavalso wants to merge 9 commits intoets-labs:developfrom
Open
Add provided()<func>.call *args, **kwargs arguments #945#946pavalso wants to merge 9 commits intoets-labs:developfrom
pavalso wants to merge 9 commits intoets-labs:developfrom
Conversation
ZipFile
requested changes
Dec 10, 2025
Contributor
ZipFile
left a comment
There was a problem hiding this comment.
Looks fine, but we need test coverage for this new feature.
ZipFile
reviewed
Jan 31, 2026
|
|
||
| @inject | ||
| def test_provided_instance_call_with_args( | ||
| some_value: int = Provide[Container.service_with_callable.provided.method_with_args.call(1, 2)] |
Contributor
There was a problem hiding this comment.
Shouldn't we test for string ids? I.e. Provide["service_with_callable", provided().method_with_args.call(1, 2)]?
Comment on lines
+8
to
+9
| self.method_with_args = lambda x, y: x + y | ||
| self.method_with_kwargs = lambda **kwargs: kwargs |
Contributor
There was a problem hiding this comment.
I think it would be better to have them as proper methods
|
|
||
| class ServiceWithCallable: | ||
| def __init__(self): | ||
| self.foo = CallableDict({"bar": lambda: 10}) |
Contributor
There was a problem hiding this comment.
Suggested change
| self.foo = CallableDict({"bar": lambda: 10}) | |
| self.foo = {"bar": lambda *args, **kwargs: {"args": args, "kwargs": kwargs}} |
Does it need to be separate dict subclass?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#945