Re: list.extend([]) Question

2010-01-30 Thread Dan Brown
On Jan 30, 8:38 am, "Alf P. Steinbach" wrote: > It does. > > 'extend' is an operation that /modifies/ the array. > > It just returns None as its expression result, in the same way as e.g. the > Python 3.x 'print' (another pure "doer" operation). > >    >>> L = ['a'] >    >>> L >    ['a'] >    >>>

list.extend([]) Question

2010-01-30 Thread Dan Brown
Why does extending a list with the empty list result in None? It seems very counterintuitive to me, at least --- I expected ['a'].extend ([]) to result in ['a'], not None. -- http://mail.python.org/mailman/listinfo/python-list