python/lagom
-
Lagom Dependency Injectionpython/lagom 2023. 1. 16. 11:11
python dependency injection library 인 lagom 을 사용해 본다. from abc import ABC from lagom import Container, Singleton class Base(ABC): def show(self): pass class A(Base): def __init__(self) -> None: print('make a') def show(self): print('show a') class A2(Base): def __init__(self) -> None: print('make a2') def show(self): print('show a2') class B: def __init__(self, a: Base) -> None: print('make b') ..