Skip to content

Support for resolving Generic types as argument #17

Description

@ticdenis

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
])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions