Differences between revisions 1 and 2
Revision 1 as of 2008-11-18 03:16:30
Size: 1477
Editor: ZoomQuiet
Comment:
Revision 2 as of 2009-11-28 14:43:20
Size: 1410
Editor: Elias
Comment: 删除对PageComment2组件的引用
Deletions are marked like this. Additions are marked like this.
Line 47: Line 47:
||<^>[[PageComment2]]||<^>[:/PageCommentData:PageCommentData]''||

TableOfContents

Include(ZPyUGnav)

直觉式类vs对象

题面儿

2008/11/18 lucas. cao <[email protected]>:
> 《Python编程金典》第7章内容,讲类,对象,方法和属性,有一个疑问:
> 类和对象的关系,对象到底是在类的里面,还是在类的外面??

偶地个神那!

马踏飞燕 <[email protected]>
reply-to        [email protected]
to      [email protected]
date    Tue, Nov 18, 2008 at 10:52
subject [CPyUG:71621] Re: 一个小疑问!

对象就是类的实例阿!哪有什么内外之分?

就拿你来说事吧。
你是人类,不是动物类的。
"人类"就是一个"类",而你就是"人类"的一个实例。
你跟"人类"之间有内外之分吗?
  • "类"在没有被实例化之前是虚无的,只是说明有一组特定属性和方法的一类东西。把类实例化了,才是实实在在能对其操作的东西。
  • 我踢了你一脚,你会觉得疼,如果我说我踢了"人类"一脚,那么谁觉得疼呢?(最关键的问题是,我这一脚往哪里踢?"人类"在那里?)


反馈

创建 by -- ZoomQuiet [DateTime(2008-11-18T03:16:30Z)]

MiscItems/2008-11-18 (last edited 2009-12-25 07:15:56 by localhost)