Re: inner sublist positions ?

2005-04-21 Thread tiissa
Bernard A. wrote: > maybe have you some better / faster ideas / implementations ? or even > a more pythonic to help me learning that You may want to look at string matches algorithm (a good review: [1]). In particular there are classics like Boyer-Moore and some involving minimal automatons simila

Re: inner sublist positions ?

2005-04-20 Thread Steven Bethard
Bernard A. wrote: hello, while trying to play with generator, i was looking for an idea to get the position of a inner list inside another one, here is my first idea : - first find position of first inner element, - and then see if the slice starting from here is equal to the inner -> def subPo

inner sublist positions ?

2005-04-20 Thread Bernard A.
hello, while trying to play with generator, i was looking for an idea to get the position of a inner list inside another one, here is my first idea : - first find position of first inner element, - and then see if the slice starting from here is equal to the inner -> >>> def subPositions(alist,