我有一个回调函数列表,我需要在触发事件时调用.这是惯用的蟒蛇吗?
def first_callback(m):
print 'first ' + m
def second_callback(m):
print 'second ' + m
lst = [first_callback, second_callback]
map(lambda x: x("event_info"),lst) #is this how you do it?
Run Code Online (Sandbox Code Playgroud) python ×1