This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
Should @implements have singleton=False? #61
pauleveritt
started this conversation in
General
Replies: 1 comment
-
It's indeed missing an example. from antidote import interface, implements, injectable, world
@interface
class Greeter:
def greet(self) -> str:
raise NotImplementedError()
@implements(Greeter)
@injectable(singleton=False)
class FrenchGreeter(Greeter):
def greet(self) -> str:
return f"{self}: Bonjour!" In the same spirit, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Not reporting as a bug, as I'm not sure the intention.
I view
@implements
as kind of isomorphic with@injectable
. Thus, you should be able to register non-singleton implementations.But perhaps I'm looking at this wrong?
Beta Was this translation helpful? Give feedback.
All reactions