摘要: Python闭包 1.什么是闭包,闭包必须满足以下3个条件: 必须是一个嵌套的函数。闭包必须返回嵌套函数。嵌套函数必须引用一个外部的非全局的局部自由变量。举个栗子 # 嵌套函数但不是闭包def nested(): def nst(): print('i am nested func %s' % ne 阅读全文
posted @ 2018-10-17 11:04 Coca-Mirinda 阅读(348) 评论(0) 推荐(0) 编辑