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

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

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

    def __init__(self, x, lst):
        self.x = x
        self.lst = lst
Пример #3
0
class OtherSaveable:

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

    def __init__(self, foo, bar):
        self.foo = foo
        self.bar = bar
Пример #4
0
class MyClass:

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

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

    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:
    """
    A class with saveable attribute, but no __init__
    """
    x = js.Int()
    y = js.String()
Пример #7
0
class NoInit:
    x = js.Int()
    y = js.String()