Skip to content

Support for resolving Generic types as argument #17

@ticdenis

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

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