Possible Duplicate:
What does@
mean in Python?
Here is the code I don't understand:
def coroutine(func):
def start(*args,**kwargs):
cr = func(*args, **kwargs)
#cr.next()
next(cr)
return cr
return start
@coroutine #<<<----- HERE
def detectChange(value):
old_value = value
while True:
new_value = (yield)
if new_value != old_value:
print ("Ouch!")
old_value = new_value
What does the @coroutine means syntax wise?