factory pattern with lambda
How would you create a factory based method using lambda? function signature looks like this. Factory gets a string parameter and returns the instance. class Foo: @abstractmethod def store(factory: Callable[[str], Bar]) obj = factory("abc") // store or call to get instance class Bar: def __init__(self): pass How to call this method using lambda? Foo.store(lambda k:… Read More factory pattern with lambda