preferred syntax for list extend?

Andy Gimblett gimbo at ftech.net
Wed Apr 17 04:24:49 EDT 2002


On Wed, Apr 17, 2002 at 10:01:48AM +0200, Ante wrote:
> 
> Even if it was faster, I would still prefer +=.  foo.extend(yada)
> doesn't look beautiful to me at all.  After all, why do we have,
> e.g. == operator so we can say if a == b and not a.equals(b)?
> Because the former is simply better looking, and to me the same
> applies to += versus .extend() or even .append()

True, but note that += won't work with old python interpreters, which
might be one reason for using extend()

-- 
Andy Gimblett - Programmer - Frontier Internet Services Limited
Tel: 029 20 820 044 Fax: 029 20 820 035 http://www.frontier.net.uk/
Statements made are at all times subject to Frontier's Terms and
Conditions of Business, which are available upon request.





More information about the Python-list mailing list