python-dependency-injector/examples/ioc_di_demos/car_engine.py
2016-05-30 22:34:58 +03:00

18 lines
326 B
Python

"""Car & Engine example."""
class Engine(object):
"""Example engine."""
class Car(object):
"""Example car."""
def __init__(self):
"""Initializer."""
self.engine = Engine() # Engine is a "hardcoded" dependency
if __name__ == '__main__':
car = Car() # Application creates Car's instance