Newbie help with extend()

Jason Stokes jstok at bluedog.apana.org.au
Mon Mar 20 02:24:43 CET 2000


Steve Holton wrote in message <38D5731C.BCDF4BE2 at mindspring.com>...
>Greetings-
>
>Can anyone post a short example showing the extend method of list?
>
>Here's what I'm seeing:
>
>[sholton at kest sholton]$ python
>Python 1.5.1 (#1, Mar 21 1999, 22:49:36)  [GCC egcs-2.91.66
>19990314/Li on linux-i386
>Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>>> a=[1,2]
>>>> type(a)
><type 'list'>
>>>> b=[3,4]
>>>> type(b)
><type 'list'>
>>>> a.extend(b)
>
>I'm expecting this to set a to [1, 2, 3, 4]
>but instead I get:
>
>Traceback (innermost last):
>  File "<stdin>", line 1, in ?
>AttributeError: extend
>
>Is this a 1.5.2 feature?


Appears to be.  This works fine with PythonWin version 1.5.2.





More information about the Python-list mailing list