Skip to content

Provide all with interfaces (Protocol, ABC) #506

Description

@Molandrious

I have a simple example:

class InterfaceSomeRepo1(ABC): ...
class InterfaceSomeRepo2(ABC): ...

class SomeRepo1(InterfaceSomeRepo1): ...
class SomeRepo2(InterfaceSomeRepo2): ...

class SomeService1:
   repo1: InterfaceSomeRepo1
   repo2: InterfaceSomeRepo2


class MyProvider(Provider):
    repos = provide_all(
          SomeRepo1,
          SomeRepo2,
)

   services = provide_all(
          SomeService1,
    )

I get error Try use WithParents or changing provides. Is any way to resolve conflict without manual mapping interface class with implementation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    To be released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions