does Python support some kind of "casting"

Terry Reedy tejarex at yahoo.com
Fri Mar 15 08:58:52 EST 2002


"Tino Lange" <tl_news at nexgo.de> wrote in message
news:a6shn9$9l6$1 at crusher.de.colt.net...
> Duncan Booth wrote:
> > Yes, that will make a copy. But copying a list is a pretty
efficient
> > operation, so no, it isn't really horribly inefficient. Have you
tried it
> > and identified this as a bottleneck? How long are your lists
anyway?
>
> 3600 Elements each.

The copy requires 4*3600+10(about) bytes - about 15000 - and less than
a millisecond with two allocations for header and list of pointers and
two machine-code memmove instructions.  Probably not a bottlenect
operation on any modern machine.

Terry J. Reedy






More information about the Python-list mailing list