2005年06月14日 星期二 21:34
在该书的1.13.6节,有这样一段话:"每个instance的name space中都有一个__class__的name,用来指向创建该instance的class对象",我想了很久,还是不明白是什么意思,哪位能不能帮忙解释一下,谢谢了! -- your friends torres -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20050614/1427d26d/attachment.html
2005年06月14日 星期二 21:52
torres wrote: > > 在该书的1.13.6节,有这样一段话:"每个instance的name space中都有一个 > __class__的name,用来指向创建该instance的class对象",我想了很久,还是不 > 明白是什么意思,哪位能不能帮忙解释一下,谢谢了! 就是说每一个对象都有一个__class__属性 .>> class MyClass: ... pass ... .>> c = MyClass() .>> c.__class__-- Qiangning Hong ____________________________________________________________ / James McNeill Whistler's (painter of "Whistler's Mother") \ | failure in his West Point chemistry examination once | | provoked him to remark in later life, "If silicon had been | \ a gas, I should have been a major general." / ------------------------------------------------------------ \ \ ,__, | | (oo)\| |___ (__)\| | )\_ | |_w | \ | | || * Cower....
Zeuux © 2025
京ICP备05028076号