@classmethod
    def fromSource(cls, s):
        compiled = eval(s)  # XXX not safe
        if isinstance(compiled, dict):
            return cls._getDictClass()(compiled)
        if isinstance(compiled, (list, tuple)):
            return cls._getListClass()(compiled)
        return compiled
>>> tl = A.fromSource('[2, 3, 4]')
dataset/ETHPy150Open petrvanblokland/Xierpa3/xierpa3/toolbox/storage/adict.py/A.fromSource