Skip to content

Instantly share code, notes, and snippets.

@GreeeenApple
Created September 13, 2016 13:14
Show Gist options
  • Save GreeeenApple/473371d39545698656961efbdba1d908 to your computer and use it in GitHub Desktop.
Save GreeeenApple/473371d39545698656961efbdba1d908 to your computer and use it in GitHub Desktop.
callbackメモ
def callback(i, d, z):
z += [i]
def hoge(callback, d=0):
for i in range(10):
callback(i, d=d)
if __name__ == "__main__":
p = []
hoge(lambda x, d, z=p: callback(x, d, z))
print(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment