作者ggirls (哥)
看板Python
标题[问题] 手册里关於class的一句话,请教
时间Thu Mar 14 13:36:12 2019
http://bit.ly/2W4ss5t
These references follow the normal rules for name resolution with an
exception that unbound local variables are looked up in the global namespace.
The namespace of the class definition becomes the attribute dictionary of the class.
最後一句话,
我读起来,该class的namespace成为__dict__?完全无法想像。可以指点一下吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 223.137.113.238
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1552541775.A.3F5.html
※ 编辑: ggirls (223.137.113.238), 03/14/2019 13:37:52
2F:→ ThxThx: 我看起来是这个意思 03/14 14:33