Monostate en python

Queda lindo por eso lo hice


class MonoState(object):

    def __getattribute__(self, name):
       return getattr(MonoState, name)

    def __setattr__(self, name, value):
       setattr(MonoState, name, value)

Se usa asi:

>>> ms1 = MonoState()
>>> ms2 = MonoState()

>>> ms1.name = "wawawa"
>>> ms2.name
'wawawa'

Leer Más