mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-25 02:53:56 +03:00
15 lines
317 B
Python
15 lines
317 B
Python
"""Factory provider example."""
|
|
|
|
from dependency_injector import providers
|
|
|
|
|
|
object_factory = providers.Factory(object)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
object1 = object_factory()
|
|
object2 = object_factory()
|
|
|
|
assert object1 is not object2
|
|
assert isinstance(object1, object) and isinstance(object2, object)
|