list as a base class in Python 2.1

Discussion in 'Python' started by bdecker@flowcom.com.au, May 4, 2004.

  1. Guest

    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?



    Ben
     
    , May 4, 2004
    #1
    1. Advertising

  2. At some point, 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
     
    David M. Cooke, May 4, 2004
    #2
    1. Advertising

  3. Guest

    Nevermind, I founf the UserList module.



    * <> [2004-05-04 02:54:07 +0000]:

    > 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?
    >
    >
    >
    > Ben
     
    , May 4, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tomek
    Replies:
    2
    Views:
    691
    Andrey Tarasevich
    Dec 1, 2003
  2. tomek
    Replies:
    3
    Views:
    766
    David Fisher
    Nov 30, 2003
  3. Alf P. Steinbach
    Replies:
    6
    Views:
    558
    John Carson
    Sep 3, 2005
  4. Hicham Mouline
    Replies:
    1
    Views:
    604
    Victor Bazarov
    Apr 20, 2009
  5. Karan Rajput
    Replies:
    2
    Views:
    150
    Abinoam Jr.
    Dec 22, 2010
Loading...

Share This Page