Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PLW2901 #353

Open
Tishka17 opened this issue Jan 26, 2025 · 3 comments
Open

PLW2901 #353

Tishka17 opened this issue Jan 26, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@Tishka17
Copy link
Member

No description provided.

@Tishka17 Tishka17 added the enhancement New feature or request label Jan 26, 2025
@Tapeline
Copy link

Tapeline commented Jan 27, 2025

PLW2901 is only encountered twice: on 58'th lines in container.py and async_container.py. I suggest extracting the following code to some function like copy_context(context)

if context:
    for key, value in context.items():
        if not isinstance(key, DependencyKey):
            key = DependencyKey(  # noqa: PLW2901
                key,
                DEFAULT_COMPONENT,
            )
        self._context[key] = value

@Tishka17
Copy link
Member Author

Introducing additional functions here affects performance.

@Tishka17
Copy link
Member Author

Let's enable check, add noqa here and that's it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants