Differences between revisions 2 and 3
Revision 2 as of 2009-11-28 14:43:20
Size: 1410
Editor: Elias
Comment: 删除对PageComment2组件的引用
Revision 3 as of 2009-12-25 07:15:56
Size: 1410
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
[[TableOfContents]] <<TableOfContents>>
Line 6: Line 6:
[[Include(ZPyUGnav)]] <<Include(ZPyUGnav)>>
Line 46: Line 46:
创建 by -- ZoomQuiet [[[DateTime(2008-11-18T03:16:30Z)]]] 创建 by -- ZoomQuiet [<<DateTime(2008-11-18T03:16:30Z)>>]

直觉式类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 [2008-11-18 03:16:30]

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