def __new__(meta, name, bases, dct):
        sanitized_dct = {}
        sanitized_dct['fields'] = {}

        class_type = type.__new__(meta, name, bases, dct)

        fields = {}

        #we inherit the fields from the base type(s)
        if hasattr(class_type,'fields'):
            fields.update(class_type.fields)

        for key,value in dct.items():
            if isinstance(value,BaseField):
                if value.key:
                    field_key = value.key
                else:
                    field_key = key
                fields[field_key] = value
                delattr(class_type,key)

        class_type.fields = fields

        global DoesNotExist,MultipleDocumentsReturned

        class DoesNotExist(DoesNotExist):
            pass

        class MultipleDocumentsReturned(MultipleDocumentsReturned):
            pass

        class_type.DoesNotExist = DoesNotExist
        class_type.MultipleDocumentsReturned = MultipleDocumentsReturned

        if document_classes in class_type:
            document_classes.remove(class_type)
        if name == 'Document' and bases == (object,):
            pass
        elif not (hasattr(class_type.Meta,'autoregister') and class_type.Meta.autoregister == False):
            document_classes.append(class_type)

        return class_type
dataset/ETHPy150Open adewes/blitzdb/blitzdb/document.py/MetaDocument.__new__/swapped operands of `in`