-
Notifications
You must be signed in to change notification settings - Fork 47
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
added resolve_all to container #114
base: develop
Are you sure you want to change the base?
added resolve_all to container #114
Conversation
Version 0.1
v0.6 docs fixes
@overload | ||
def resolve_all(self, components: None = None) -> None: ... | ||
@overload | ||
def resolve_all(self, components: Literal[True]) -> None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of that?
@overload | ||
def resolve_all(self, components: Iterable[Component]) -> None: ... | ||
|
||
def resolve_all(self, components: Any = None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need specify components? What's the use case?
""" | ||
if not components: | ||
|
||
def component_check(k: DependencyKey) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of nested functions
return k.component in components | ||
|
||
for key in filter(component_check, self.registry.factories): | ||
with suppress(NoContextValueError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
@overload | ||
def resolve_all(self, components: Iterable[Component]) -> None: ... | ||
|
||
def resolve_all(self, components: Any = None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to call parent container method as well?
It is not yet clear what we are planning to achive. I'm keeping this PR open so we could return when implementing #198 or something related |
No description provided.