> On Jun 18, 2017, at 11:02 PM, Chris Angelico <ros...@gmail.com> wrote: > > On Mon, Jun 19, 2017 at 3:54 PM, Steven D'Aprano <st...@pearwood.info> wrote: >>> With a list? No, I would say it's a bad idea. >> >> >> Why a bad idea? >> >> As opposed to "can't be done", or "too hard and slow". > > Maintaining a record of list indices inside an object, with the > specific proviso that: > >> If the list is changed, the list updates the indices. >
A linked list with pointers to the next and previous items? If this was a homework problem, a linked list is usually implemented in C. The list keyword in Python is not the same thing. Chris R. -- https://mail.python.org/mailman/listinfo/python-list