Is a list an instance of a class?

Fran=?ISO-8859-1?B?5w==?=ois Granger fgranger at fgranger.com
Sun Nov 14 15:50:14 EST 2004


Le 14/11/04 21:33, « Kent Johnson » <kent3737 at yahoo.com> a écrit :

> Is this still correct or was it made obsolete by Python 2.2? Lists and
> files have __class__ attributes, at least:

As you disovered, this is obsolete. You even have some emulation you can
built on :

Python 2.3 (#1, Sep 13 2003, 00:49:11)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import UserList
>>> dir (UserList)
['UserList', '__builtins__', '__doc__', '__file__', '__name__']

For me, this file resides in:

/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/UserL
ist.py 

You will find others as well.

-- 
François Granger
 fgranger at fgranger.com
+ 33 6 61 36 96 17 (mobile)
+ 33 1 47 35 00 16 (home)





More information about the Python-list mailing list