def __init__(self, field, key_field=Field, name=None, default=None): Field.__init__(self, name=name, default=default or {}) def mkfield(f): if type(f) is type: if issubclass(f, Field): return f() elif issubclass(f, Schema): return DictField(f) return f self.field = mkfield(field) self.key_field = mkfield(key_field)
def __init__(self, name=None, default=None): Field.__init__(self, name=name, default=default or {})