def register_custom_objects(mapping, merge=False): if merge: res = t.merge(REGISTERED_CUSTOM_OBJECTS, mapping) else: res = mapping REGISTERED_CUSTOM_OBJECTS = res #TODO: move custom_objects into the attrs