Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2007-03-08 02:28:26
Size: 426
Editor: ZoomQuiet
Comment:
Revision 6 as of 2009-11-28 12:04:05
Size: 1425
Editor: Elias
Comment: 删除对PageComment2组件的引用
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
'''Class''' 和 '''Type''' 在Py 中有什么区别?
Line 16: Line 17:
 * `Leira Hua <[email protected]>;Mar 7, 2007 5:15 PM`
  * 关于type和class的差别,"'[http://www.cafepy.com/article/python_types_and_objects Python Types and Objects]'"这篇文章讲得非常详
细,推荐阅读。
 * `Nick Cen <[email protected]> ;Mar 7, 2007 8:02 PM`{{{
我同意yi huang说的type是内置类型的概念。
在OO里面不管你类怎么定义,类的所有属性最终都是指向一些系统的内置类型。这些类型的名字就叫做type。

我觉得这跟数学里面数的定义一样。1是最基本的,其他的数字都可以通过对1进行加法来定义,而1本身则无法通过加法这个法则来定义。

面向对象也是这样,所有的对象,都可以通过组合其他对象和一些内置属性进行定义。而这些内置属性则是无法通过语言本身提供的面向对象机制定义的。
}}}
=== 理Vs解 ===
||<^> [[Include(/shhgs)]] ||<^> [[Include(/yihuang)]] ||
Line 18: Line 32:
[[PageComment2]]

[http://groups.google.com/group/python-cn/browse_thread/thread/e18f109622b2ef76 哪位大哥知道type 与class 的区别?] -- 引发的深入理解 ::-- ZoomQuiet [DateTime(2007-03-08T02:28:26Z)] TableOfContents

Include(CPUGnav)

1. 讨论

持续中....

1.1. 问题

ClassType 在Py 中有什么区别?

1.2. 理解

细,推荐阅读。

  • Nick Cen <[email protected]> ;Mar 7, 2007 8:02 PM

    我同意yi huang说的type是内置类型的概念。
    在OO里面不管你类怎么定义,类的所有属性最终都是指向一些系统的内置类型。这些类型的名字就叫做type。
    
    我觉得这跟数学里面数的定义一样。1是最基本的,其他的数字都可以通过对1进行加法来定义,而1本身则无法通过加法这个法则来定义。
    
    面向对象也是这样,所有的对象,都可以通过组合其他对象和一些内置属性进行定义。而这些内置属性则是无法通过语言本身提供的面向对象机制定义的。

1.2.1. 理Vs解

Include(/shhgs)

Include(/yihuang)

2. 反馈

PyClassAndType (last edited 2009-12-25 07:16:35 by localhost)