Deleting the first element of a list

Paul Rubin phr-n2002b at NOSPAMnightsong.com
Thu Oct 3 09:09:13 EDT 2002


Alex Martelli <aleax at aleax.it> writes:
> You might claim this is an issue of choice of algorithm and not of
> idiom, but to me that doesn't make much difference.  Some people
> may find the following idiom more readable (they certainly DO,
> because it keeps popping up...):
> 
>     bigstring = ''
>     while somecondition():
>         bigstring += onemoretinypiece()
> 
> but it doesn't matter -- it's still the wrong idiom to use in
> Python, as its big-O behavior is a disaster.  

Don't you think that's kind of a deficiency in Python?  Python could
fix that by having mutable string objects, either under or over the covers.



More information about the Python-list mailing list