TechToFreedom
Published in

TechToFreedom

3 Levels of Understanding the Singleton Pattern in Python

The most controversial design pattern

3 Levels of Understanding the Singleton Pattern in Python
Photo by Dragos Gontariu on Unsplash

The singleton is a simple but controversial design pattern. For some classes that only one instance of them is needed, such as logging, settings, caches or device drivers related objects, instantiating more than one instances could introduce many unexpected bugs. Therefore, the idea of singleton, which…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yang Zhou

Yang Zhou

Senior Full-Stack Engineer | Top Writer | Join me in Medium: https://yangzhou1993.medium.com/membership