class Singleton(object):

    def __new__(cls, *args, **kwargs):
        if not hasattr(cls, '_inst'):
            cls._inst = super(Singleton, cls).__new__(cls, *args, **kwargs)
            return cls._inst


s1 = Singleton()
s2 = Singleton()
print(s1)
print(s2)

0607f3d0655a6453a7643b74f7c1f48c6174856d
class Singleton(object):
    <mask token>


<mask token>

class Singleton(object):

    def __new__(cls, *args, **kwargs):
        if not hasattr(cls, '_inst'):
            cls._inst = super(Singleton, cls).__new__(cls, *args, **kwargs)
            return cls._inst


<mask token>

class Singleton(object):

    def __new__(cls, *args, **kwargs):
        if not hasattr(cls, '_inst'):
            cls._inst = super(Singleton, cls).__new__(cls, *args, **kwargs)
            return cls._inst


<mask token>
print(s1)
print(s2)

class Singleton(object):

    def __new__(cls, *args, **kwargs):
        if not hasattr(cls, '_inst'):
            cls._inst = super(Singleton, cls).__new__(cls, *args, **kwargs)
            return cls._inst


s1 = Singleton()
s2 = Singleton()
print(s1)
print(s2)
