[issue33879] Item assignment in tuple mutates list despite throwing error

2018-06-16 Thread R. David Murray


Change by R. David Murray :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33879] Item assignment in tuple mutates list despite throwing error

2018-06-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Interesting. I googled this and came across this note which covers this : 
https://docs.python.org/2/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33879] Item assignment in tuple mutates list despite throwing error

2018-06-16 Thread njayinthehouse


New submission from njayinthehouse :

Seems like a bug.

>>> a = (1, [1])
>>> a[1] += [2]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'tuple' object does not support item assignment
>>> a
(1, [1, 2])

--
messages: 319748
nosy: njayinthehouse
priority: normal
severity: normal
status: open
title: Item assignment in tuple mutates list despite throwing error
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com