A minimal Python library providing a @singleton decorator to turn classes into singletons. Version 0.2.1, released Oct 2014. It is in maintenance mode with rare updates.
pip install pysingletonNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Apply @singleton to a class to ensure only one instance exists.
Add a threading lock inside the class's __new__ method or use a thread-safe singleton pattern.
Avoid subclassing singletons; apply @singleton to each class individually.
Use Python 3 compatible libraries like 'singledispatch' or custom metaclass for production code.
No dependency data recorded yet.