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

Default parameters can still raise MissingDependencyError #204

Open
sbischoff-ai opened this issue Jan 28, 2025 · 0 comments
Open

Default parameters can still raise MissingDependencyError #204

sbischoff-ai opened this issue Jan 28, 2025 · 0 comments

Comments

@sbischoff-ai
Copy link

Hi. The issue described in #31 and fixed in #40 still arises in some cases.

This:

import punq

class A:
    pass

class B:
    def __init__(self, a: A, x: int | None = None):
        pass

container = punq.Container()
container.register(A)
container.register(B)
container.resolve(B)

will still raise:

punq.MissingDependencyError: Failed to resolve implementation for int | None

(version 0.7.0)

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

No branches or pull requests

1 participant