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

added resolve_all to container #114

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

la5tway
Copy link

@la5tway la5tway commented Mar 27, 2024

No description provided.

@la5tway la5tway closed this Mar 27, 2024
@la5tway la5tway reopened this Mar 27, 2024
@overload
def resolve_all(self, components: None = None) -> None: ...
@overload
def resolve_all(self, components: Literal[True]) -> None: ...
Copy link
Collaborator

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:
Copy link
Collaborator

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:
Copy link
Collaborator

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):
Copy link
Collaborator

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:
Copy link
Collaborator

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?

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

Successfully merging this pull request may close these issues.

None yet

2 participants