Re: newbie Q: sequence membership

2007-11-18 Thread saccade
On Nov 17, 3:40 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > You can write your own membership test based on identity ('is'): > Thank you for the practical (usable) advice and explanation of the '==' operator. On Nov 17, 4:35 am, John Machin <[EMAIL PROTECTED]> wrote: > > And that can

newbie Q: sequence membership

2007-11-16 Thread saccade
>>> a, b = [], [] >>> a.append(b) >>> b.append(a) >>> b in a True >>> a in a Traceback (most recent call last): File "", line 1, in RuntimeError: maximum recursion depth exceeded in cmp >>> >>> a is a[0] False >>> a == a[0] Traceback (most recent call last): File "", line 1, in RuntimeError: