returns generator yielding instances of the class

def select_models(clas,pool_or_cursor,**kwargs):
    "returns generator yielding instances of the class"
    if 'columns' in kwargs: raise ValueError("don't pass 'columns' to select_models")
    return (set_options(pool_or_cursor,clas(*row)) for row in clas.select(pool_or_cursor,**kwargs))