class ClassWithDict(js.JsonSaveable):
    x = js.Int()
    d = js.Dict()

    def __init__(self, x, d):
        self.x = x
        self.d = d
class ClassWithList(js.JsonSaveable):

    x = js.Int()
    lst = js.List()

    def __init__(self, x, lst):
        self.x = x
        self.lst = lst
예제 #3
0
class OtherSaveable(js.JsonSaveable):

    foo = js.String()
    bar = js.Int()

    def __init__(self, foo, bar):
        self.foo = foo
        self.bar = bar
예제 #4
0
class MyClass(js.JsonSaveable):

    x = js.Int()
    y = js.Float()
    lst = js.List()

    def __init__(self, x, lst):
        self.x = x
        self.lst = lst
class SimpleClass(js.JsonSaveable):

    a = js.Int()
    b = js.Float()

    def __init__(self, a=None, b=None):
        if a is not None:
            self.a = a
        if b is not None:
            self.b = b
class NoInit(js.JsonSaveable):
    x = js.Int()
    y = js.String()