List append vs add

Michael Hudson mwh at python.net
Fri May 25 03:45:47 EDT 2001


Tim Howarth <tim at worthy.demon.co.uk> writes:

> Is there any difference in result, performance or stylistic approval
> ('niceness') of;
> 
> list.append('fred')
> 
> compared with,
> 
> list+=['fred']

There is no difference in result.  The former strikes me as clearer,
and might well be quicker.

Cheers,
M.

-- 
  QNX... the OS that walks like a duck, quacks like a duck, but is,
  in fact, a platypus. ... the adventures of porting duck software 
  to the platypus were avoidable this time.
                                 -- Chris Klein, alt.sysadmin.recovery



More information about the Python-list mailing list