list as a base class in Python 2.1

David M. Cooke cookedm+news at physics.mcmaster.ca
Mon May 3 23:27:07 EDT 2004


At some point, bdecker at flowcom.com.au wrote:

> Hello,
>
> With python2.2 I am able to define a class based on the 'list' type as
> follows:
>
> class sample(list):
>  ...
>
> But this doesn't work under python 2.1. Is there still a way to simply
> use the list type as a base class under python 2.1?

No. But you could try the UserList module, which will make it easier
to emulate a list.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list