Singleton API Documentation

singleton.py Implementation of the Singleton design pattern in Python.

This module defines a Singleton class to ensure that only one instance of the class is created during the program’s lifetime.

class SingletonMeta[source]

Bases: type

A metaclass for creating Singleton classes.

Ensures that only one instance of the class exists.

class Singleton(*args, **kwargs)[source]

Bases: object

A Singleton class that uses the SingletonMeta metaclass.

do_something()[source]

An example method demonstrating Singleton functionality.

This method performs an example action to showcase how to use the Singleton instance.

Returns:

A message indicating that the Singleton instance is working.

Return type:

str