[ python-Bugs-1067018 ] Obsolete info in Tutorial 9.1

SourceForge.net noreply at sourceforge.net
Wed Nov 17 20:03:54 CET 2004


Bugs item #1067018, was opened at 2004-11-15 17:50
Message generated for change (Comment added) made by tjreedy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1067018&group_id=5470

Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Kent Johnson (kjohnson)
Assigned to: Nobody/Anonymous (nobody)
Summary: Obsolete info in Tutorial 9.1

Initial Comment:
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

----------------------------------------------------------------------

Comment By: Terry J. Reedy (tjreedy)
Date: 2004-11-17 14:03

Message:
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.

----------------------------------------------------------------------

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-11-16 15:51

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1067018&group_id=5470


More information about the Python-bugs-list mailing list