Use :class:`Singleton` as a decorator for Python 2/3 compatibility::

            @Singleton.as_decorator
            class SingletonType(object):
                def __repr__(self):
                    return 'singleton'

            singleton = SingletonType()

        :param cls: Class to become a singleton
        :type cls: type
        :return: The new singleton
        :rtype: Singleton

def as_decorator(mcs, cls):
        """
        Use :class:`Singleton` as a decorator for Python 2/3 compatibility::

            @Singleton.as_decorator
            class SingletonType(object):
                def __repr__(self):
                    return 'singleton'

            singleton = SingletonType()

        :param cls: Class to become a singleton
        :type cls: type
        :return: The new singleton
        :rtype: Singleton
        """
        return mcs(cls.__name__, cls.__bases__, cls.__dict__.copy())