In <mailman.298.1330534919.3037.python-l...@python.org> James Broadhead 
<jamesbroadh...@gmail.com> writes:

> On 29 February 2012 13:52, Johann Spies <johann.sp...@gmail.com> wrote:
> > In [82]: t.append(instansie)
> > t.append(instansie)
> >
> > In [83]: t
> > t
> > Out[83]: ['Mangosuthu Technikon']

> > In [84]: t = [x.alt_name for x in lys].append(instansie)
> > t = [x.alt_name for x in lys].append(instansie)
> >
> > In [85]: t
> > t
> >
> > In [86]: type t
> > type t
> > -------> type(t)
> > Out[86]: NoneType
> >

> You should note that in [82], you're not doing:
> > t = t.append(instansie)

append() modifies the list in-place.  It doesn't return anything.
(and therefore its return value is None)

>>> x = [1, 2, 3]
>>> y = x.append(4)
>>> print x
[1, 2, 3, 4]
>>> print y
None

-- 
John Gordon                   A is for Amy, who fell down the stairs
gor...@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to