Marco Mariani <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > >> It does this: >> >>>>> @greedy >> def getCommandsFromUser(): >> while True: >> yield raw_input('Command?') >> >> >>>>> for cmd in getCommandsFromUser(): >> print "that was command", cmd >> >> >> Command?hello >> Command?goodbye >> that was command hello >> Command?wtf >> that was command goodbye >> Command? > > > Not here.. > > > In [7]: def getCommandsFromUser(): > while True: > yield raw_input('Command?') > ...: > ...: > > In [10]: for cmd in getCommandsFromUser(): print "that was command", cmd > ....: > Command?hi > that was command hi > Command?there > that was command there > Command?wuwuwuw > that was command wuwuwuw > Command? >
Perhaps if you'd copied all of my code (including the decorator that was the whole point of it)... -- http://mail.python.org/mailman/listinfo/python-list