The Singleton pattern ensures that a class has only one instance throughout the lifetime of a program, and provides a global access point to that instance.
This is useful for managing shared resources — loggers, configuration managers, and database connection pools are all commonly implemented as Singletons.
Implement the Singleton class such that:
Singleton is ever createdSingleton() returns the same objectSingleton() is Singleton() always returns TrueAlso implement Singleton.reset() — a classmethod that clears the stored instance. This is used for testing purposes only and would not appear in a production implementation.
Note: This is the single-threaded implementation. Thread safety is not required here.
Constraints:
__new__reset() must allow a fresh instance to be created after it is called