On 27.02.14, 7:30 , Frank Millman wrote:
> Hi all
>
> I noticed this a little while ago, but dismissed it as a curiosity.
> On reflection, I decided to mention it here in case it indicates a
> problem.
>
> This is with python 3.3.2.
>
> C:\>python -m timeit -s "import copy" "copy.copy('a'*1000)"
* [EMAIL PROTECTED] wrote, On 3/29/07 2:09 AM:
> hi
> which is the best methods to use for list copying. using list() , [:]
> or create list through list comprehension. what are the differences
> between these ?
> thanks
>
depends on what you intend to do:
-create a new object:
use a list comp
* Alex Martelli wrote, On 3/29/07 9:46 AM:
> <[EMAIL PROTECTED]> wrote:
>> another query, in the docs, list(a) and a[:] does the same thing (a =
>> [1,2,3] for example), but besides the speed of slicing is faster than
>> list(), what advantage is there for using list(a) in this case ?
>
> Readabil