levent wrote:
> Thanks for the answers. Enumerating in reverse is indeed quite a smart
> idea.
>
> The fact is though, I overly simplified the task in the super-hero
> example. In the real case, the dictionary keys are not necessarily the
> indices for inserts; that is to say, the inserts do not n
In <[EMAIL PROTECTED]>, levent wrote:
> I think I was thinking more of a linked-list idea, where you do not
> store the indices as integers to some random access array but rather as
> pointers into list's nodes. Then the subsequent inserts would not hurt
> previously stored pointers. For those who
levent wrote:
> Thanks for the answers. Enumerating in reverse is indeed quite a smart
> idea.
>
> The fact is though, I overly simplified the task in the super-hero
> example. In the real case, the dictionary keys are not necessarily the
> indices for inserts; that is to say, the inserts do not
Thanks for the answers. Enumerating in reverse is indeed quite a smart
idea.
The fact is though, I overly simplified the task in the super-hero
example. In the real case, the dictionary keys are not necessarily the
indices for inserts; that is to say, the inserts do not necessarily
take place in s
[EMAIL PROTECTED] wrote:
> # I have a list of names:
> names = ['clark', 'super', 'peter', 'spider', 'bruce', 'bat']
>
> # and another set of names that I want to insert into
> # the names list at some indexed locations:
> surnames = { 1: 'kent', 3:'parker', 5:'wayne' }
>
> # The thing I couldn't
En/na [EMAIL PROTECTED] ha escrit:
> Hi,
>
> I have a very simple problem, but do not know an elegant way to
> accomplish this.
> ###
> # I have a list of names:
> names = ['clark', 'super', 'peter', 'spider', 'bruce', 'bat']
>
> # and another set of names that I want to insert into
> # the names
[EMAIL PROTECTED] schrieb:
> Hi,
>
> I have a very simple problem, but do not know an elegant way to
> accomplish this.
> ###
> # I have a list of names:
> names = ['clark', 'super', 'peter', 'spider', 'bruce', 'bat']
>
> # and another set of names that I want to insert into
> # the names list at
Hi,
I have a very simple problem, but do not know an elegant way to
accomplish this.
###
# I have a list of names:
names = ['clark', 'super', 'peter', 'spider', 'bruce', 'bat']
# and another set of names that I want to insert into
# the names list at some indexed locations:
surnames = { 1: 'kent'