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

Support for resolving Generic types as argument #17

Open
ticdenis opened this issue Nov 25, 2022 · 0 comments
Open

Support for resolving Generic types as argument #17

ticdenis opened this issue Nov 25, 2022 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ticdenis
Copy link
Collaborator

Currently is not supported if we have something like:

from typing import TypeVar


Driver = TypeVar('Driver')

class Connection(Generic[Driver]):
  ...
  
class FakeConnection(Connection[int]):
  ...
  
class App:
  def __init__(self, connection: Connection[int]) -> None:
    self._connection = connection

When we try to resolve Connection as an argument will fail, example:

# ...

di.resolve([
  (Connection, FakeConnection()),
  (App), # will fail
])
@ticdenis ticdenis added bug Something isn't working help wanted Extra attention is needed labels Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant