list insertion

Randy Bush randy at psg.com
Sat Aug 27 23:48:31 EDT 2005


>>    hold = self.next
>>    self.next = DaClass(value)
>>    self.next.next = hold
>>
>> but i suspect (from print statement insertions) that the result
>> is not as i expect.  as the concept and code should be very
>> common, as i am too old for pride, i thought i would ask.
> I think you're fine.

indeed.  the bug was elsewhere.  i got confused and tried to
look-ahead too far when i could have just recursed.  i threw
away the too-clever code and replaced it with one line.  i
love it when that happens.

randy




More information about the Python-list mailing list