python 踩坑系列之遲綁定

1.綁定     將函數體和函數調用關聯起來,就叫綁定python 2.遲綁定     在程序運行以前(也就是編譯和連接時)執行的綁定是早綁定,遲綁定(late binding)是發生在運行時。閉包 3.實例說明 def outer():     return [lambda x: x*i for i in range(3)] f1, f2, f3 = outer() print f1(1) pr
相關文章
相關標籤/搜索