mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-29 21:14:00 +03:00
19 lines
300 B
Python
19 lines
300 B
Python
"""Car & Engine example 2."""
|
|
|
|
|
|
class Engine(object):
|
|
"""Example engine."""
|
|
|
|
|
|
class Car(object):
|
|
"""Example car."""
|
|
|
|
def __init__(self, engine):
|
|
"""Initializer."""
|
|
self.engine = engine
|
|
|
|
|
|
if __name__ == '__main__':
|
|
car = Car(Engine())
|
|
assert car.engine is not None
|