On 7/10/19 6:30 PM, Sarah Hembree wrote: > How might I best make a linked list subscriptable? Below is skeleton code > for a linked list (my > actual is much more). I've done __iter__ and __next__ but I would like to > be able to do start:stop:stride I just can't figure out how. Suggestions or > just hints please?
As a learning exercise this can be interesting, but as to practical applications, one would like to ask "why"? If index into the list is important, then choose a regular list; the "interesting" part of a linked list, which is "next node" is then available as index + 1. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor