From 033a97d4da991ec257c4ebfc237690d567b21681 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Fri, 24 Jul 2015 12:23:10 +0300 Subject: [PATCH] Removing old Factory&Singleton examples --- examples/readme/providers.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 examples/readme/providers.py diff --git a/examples/readme/providers.py b/examples/readme/providers.py deleted file mode 100644 index 1d0dff6f..00000000 --- a/examples/readme/providers.py +++ /dev/null @@ -1,22 +0,0 @@ -"""`NewInstance` and `Singleton` providers example.""" - -from objects.providers import NewInstance -from objects.providers import Singleton - - -# NewInstance provider creates new instance of specified class on every call. -new_object = NewInstance(object) - -object_1 = new_object() -object_2 = new_object() - -assert object_1 is not object_2 - -# Singleton provider creates new instance of specified class on first call -# and returns same instance on every next call. -single_object = Singleton(object) - -single_object_1 = single_object() -single_object_2 = single_object() - -assert single_object_1 is single_object_2