View Single Post
Old Jul 14th, 2006, 6:01 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Not that I know of, but you can get all variables in a scope. Since all functions have their own own scope, and since create no new variables, your process function could be replaced with:
def process(data_start, data_limit):
    data_start += 1
    print data_start
    return (), vars()
Also, since you're not using *args, you can do away with it. And you don't need if statements when you're only returning boolean values.
def process(data_start, data_limit):
    data_start += 1
    print data_start
    return vars()

def evaluate(data_start, data_limit):
    return data_start != data_limit

def repeat(p, e, **kwargs):
    while e(**kwargs): kwargs = p(**kwargs)

repeat(process, evaluate,
       data_start=0, data_limit=10)
Arevos is offline   Reply With Quote