作者changyuheng (張昱珩)
看板Python
標題[問題] 動態掛 method 進 object
時間Wed May 27 16:25:59 2015
請問如果我想利用 decorator 動態掛 method 到某個 object 中,這樣寫會不會很怪?
http://bit.ly/1cYX3dA
--
http://changyuheng.github.io/
http://murmuring-on-the-air.github.io/
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.224.196.227
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1432715164.A.451.html
※ 編輯: changyuheng (36.224.196.227), 05/27/2015 16:26:52
→ uranusjr: register 裡面的 Api class 根本沒必要 (函式就夠了) 05/27 16:36
→ uranusjr: 其他層面上還滿正常的, 不算太奇特的做法 05/27 16:37
→ uranusjr: gist.github.com/uranusjr/1e824ad86f02d0a262e2 05/27 16:40
→ changyuheng: 感謝! 05/27 17:07