寫出一個@log的decorator 既支持@log也支持@log('xxx')

log()() 第一個()表示調用log() 第二個()表示wrapp裏面的func 流程解讀: 輸入命令動作放入ss 如果[email protected] 然後就調用log()(nows) 因爲log()爲空所以不會匹配log函數裏面的if args != ' ' 不會打印args[0] 關於args與kw的認識可以參考這個博主寫的 簡單易懂 http://blog.sina.com.cn/s
相關文章
相關標籤/搜索