Issue1067018
Created on 2004-11-15 22:50 by kjohnson, last changed 2004-11-18 06:22 by rhettinger.
| Messages (4) | |||
|---|---|---|---|
| msg23158 - (view) | Author: Kent Johnson (kjohnson) | Date: 2004-11-15 22:50 | |
In the Tutorial, section 9.1, the second paragraph (starting with "I also have to warn you") is obsolete - integers and list are now instances of <type 'int'> and <type 'list'> if I understand correctly. For a brief discussion on c.l.python see http://groups.google.com/groups?hl=en&lr=&c2coff=1&threadm=ad052e5c.0411150401.2b215499%40posting.google.com&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26c2coff%3D1%26group%3Dcomp.lang.python Kent |
|||
| msg23159 - (view) | Author: Johannes Gijsbers (jlgijsbers) | Date: 2004-11-16 20:51 | |
Logged In: YES user_id=469548 This isn't really obsolete, technically speaking. Types look a lot more like classes since Python 2.2, but they're not the same. I don't know whether we still want to introduction in the tutorial, though, so I'm leaving this open for now. |
|||
| msg23160 - (view) | Author: Terry J. Reedy (tjreedy) | Date: 2004-11-17 19:03 | |
Logged In: YES user_id=593130 Instances of builtin types were always just that. So this is not new. What is new in 2.2 (I think) is that they gained a .__class__ attribute pointing to the type. >>> 1 .__class__ <type 'int'> In addition, the builtin types, including type itself, are now subclasses of object (via their __bases__ attribute), even though their .__class__ attributes point to type instead. >>> issubclass(int, object) 1 >>> int.__bases__ (<type 'object'>,) >>> int.__class__ <type 'type'> So I think the warning, as now written, is arguably untrue, or at least confusing rather than helpful. |
|||
| msg23161 - (view) | Author: Raymond Hettinger (rhettinger) | Date: 2004-11-18 06:22 | |
Logged In: YES user_id=80475 Zapped the useless and confusing paragraph. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2004-11-15 22:50:42 | kjohnson | create | |