摘要:
1、先明白这段代码 def foo(): print('foo') foo # 表示是函数 foo() # 表示执行foo函数 def foo(): print('foo') foo = lambda x: x + 1 foo() # 执行lambda表达式,而不再是原来的foo函数,因为foo这个 阅读全文
posted @ 2019-12-28 23:58
1769987233
阅读(135)
评论(0)
推荐(0)
摘要:
1. 函数引用 def test1(): print("测试函数") test1() # 测试函数 ret = test1 print(id(ret)) # 1929668379992 print(id(test1)) # 1929668379992 ret() # 测试函数 2. 什么是闭包 # 阅读全文
posted @ 2019-12-28 23:34
1769987233
阅读(107)
评论(0)
推荐(0)
摘要:
import threading, time class Test(): def test1(self): print("--") time.sleep(3) print(" ") def test2(self): print("==") time.sleep(3) print(" ") def r 阅读全文
posted @ 2019-12-28 03:34
1769987233
阅读(160)
评论(0)
推荐(0)

浙公网安备 33010602011771号