On Fri, Apr 01, 2011 at 07:31:56PM +0530, Noufal Ibrahim wrote:
> Would anyone here characterise this as a bug?
http://bugs.python.org/issue11562
--
Senthil
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/ban
On Fri, Apr 01 2011, Ruchir Shukla wrote:
> Hello,
>
> This is just because you are changing the value of b and in foo there is a
> reference of b.
>
> while in
foo = (1,[2,3,4])
foo[1] += [6]
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: 'tuple' object does n
On Fri, Apr 01 2011, Roshan Mathews wrote:
> On Fri, Apr 1, 2011 at 18:44, Hussain Bohra wrote:
>> Atleast on changing list, you gets an exception.
>>
>> On updating dictionary living inside tuple wont throw an exception as well.
>>
> I thought the surprising part was that it threw an exception,
On Friday 01 April 2011 06:51 PM, Roshan Mathews wrote:
On Fri, Apr 1, 2011 at 18:25, Navin Kabra wrote:
With Python 2.6.5 (on ubuntu) I get even more bizarre behavior:
foo=(1,[2,3,4])
foo[1]+=6
foo[1]+6 won't work anyways
l = [2,3,4]
l+=6 # same error
foo[1] += [6] # treated as tuple o
Hello,
This is just because you are changing the value of b and in foo there is a
reference of b.
while in
>>> foo = (1,[2,3,4])
>>> foo[1] += [6]
Traceback (most recent call last):
File "", line 1, in
TypeError: 'tuple' object does not support item assignment
>>> foo
(1, [2, 3, 4, 6])
>>>
it i
On Fri, Apr 01 2011, Navin Kabra wrote:
> With Python 2.6.5 (on ubuntu) I get even more bizarre behavior:
foo=(1,[2,3,4])
foo[1]+=6
Use [6] rather than 6.
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: 'int' object is not iterable
foo
> (1, [8, 9, 10])
On Fri, Apr 01 2011, Baishampayan Ghose wrote:
[...]
foo = (1, [2, 3, 4])
foo[1].append(5)
foo
> (1, [2, 3, 4, 5])
foo[1].append(6)
foo
> (1, [2, 3, 4, 5, 6])
This is an inplace modification. Does the other one "change" the list in
some sense that the tuple gets annoyed
On Fri, Apr 1, 2011 at 18:44, Hussain Bohra wrote:
> Atleast on changing list, you gets an exception.
>
> On updating dictionary living inside tuple wont throw an exception as well.
>
I thought the surprising part was that it threw an exception, not that
it updated the list. Even more surprising
On Fri, Apr 1, 2011 at 18:25, Navin Kabra wrote:
> With Python 2.6.5 (on ubuntu) I get even more bizarre behavior:
foo=(1,[2,3,4])
foo[1]+=6
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: 'int' object is not iterable
foo
> (1, [8, 9, 10])
>
Couldn't reprod
>>>
Both python 2.6 and 3.1 behaves in the same way.
Thanks and Regards,
Hussain Bohra
Tavant Technologies,
Bangalore-95
mail-to:hussain.bo...@tavant.com
mobile : +91 99867 95727
From: Navin Kabra
To: Bangalore Python Users Group - India
Sent: Fri, 1
On Fri, Apr 1, 2011 at 6:17 PM, Noufal Ibrahim wrote:
> Came across this at PyCon. Comments?
>
foo = (1,[2,3,4])
foo[1] += [6]
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: 'tuple' object does not support item assignment
foo
> (1, [2, 3, 4, 6])
Even nice
With Python 2.6.5 (on ubuntu) I get even more bizarre behavior:
>>> foo=(1,[2,3,4])
>>> foo[1]+=6
Traceback (most recent call last):
File "", line 1, in
TypeError: 'int' object is not iterable
>>> foo
(1, [8, 9, 10])
On Fri, Apr 1, 2011 at 6:17 PM, Noufal Ibrahim wrote:
>
> Came across thi
Came across this at PyCon. Comments?
>>> foo = (1,[2,3,4])
>>> foo[1] += [6]
Traceback (most recent call last):
File "", line 1, in
TypeError: 'tuple' object does not support item assignment
>>> foo
(1, [2, 3, 4, 6])
>>>
--
___
BangPypers mailing
13 matches
Mail list logo