On Mon, 19 Nov 2007 16:06:36 -0500, Sells, Fred wrote:
>> >>> a, b = [], []
>> >>> a.append(b)
>> >>> b.append(a)
> did you perhaps mean a.append('b'); b.append('a'); otherwise this seems
> pretty advanced for a newbie
If you had bothered to read the rest of the post, you'd see that he meant
exa
> >>> a, b = [], []
> >>> a.append(b)
> >>> b.append(a)
did you perhaps mean a.append('b'); b.append('a'); otherwise this seems pretty
advanced for a newbie
> >>> b in a
> True
> >>> a in a
> Traceback (most recent call last):
> File "", line 1, in
> RuntimeError: maximum recursion depth exce
En Mon, 19 Nov 2007 03:32:12 -0300, saccade <[EMAIL PROTECTED]> escribió:
> So if I am permitted to think of integers as immutable objects with
> predefined labels (i.e. the integers used in the text of the program
> code) that cannot de or re referenced then what a similar treatment of
> characte
>
> On Nov 17, 4:35 am, John Machin <[EMAIL PROTECTED]> wrote:
>> Worse: Consider z = ['A1', 'Z9']. It's highly likely that when x ==
>> 'A1', "x is_in z" is True -- because an unguaranteed implementation-
>> dependent caper caches or "interns" some values, so that x and z[0]
>> are the same objec
On Nov 19, 12:32 am, saccade <[EMAIL PROTECTED]> wrote:
> I am not a programmer so I feel odd commenting about language design
> decisions. When my Prof. introduced python the first question that
> popped into mind was that since "x=9; y=9; print x is y and x == y"
> prints "True" is there a way t
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
On Nov 17, 6:02 pm, saccade <[EMAIL PROTECTED]> wrote:
> >>> 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 =
En Sat, 17 Nov 2007 04:02:12 -0300, saccade <[EMAIL PROTECTED]> escribió:
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]
>
>>> 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: