This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: assignment operator += does not behave same as a = a + b for List
Type: behavior Stage: resolved
Components: Versions: Python 3.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: archi-pandey, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2014-11-25 05:46 by archi-pandey, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Operator_bug_python.py archi-pandey, 2014-11-25 05:46 python module
Messages (3)
msg231633 - (view) Author: Archana Pandey (archi-pandey) Date: 2014-11-25 05:46
List is mutable with += operator. But the same cannot be achieved when we use arithmatic + and assignment = operator used

Please Find the attached python module
msg231637 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2014-11-25 06:19
This is by design. I'm sure if you email python-list then someone there will be able to explain how the difference can help you write clearer code than if they both behaved exactly the same.
msg231638 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2014-11-25 06:20
Info about python-list is at https://mail.python.org/mailman/listinfo/python-list
History
Date User Action Args
2022-04-11 14:58:10adminsetgithub: 67127
2014-11-25 06:23:15zach.waresetcomponents: - Windows
2014-11-25 06:22:53zach.waresetstage: resolved
2014-11-25 06:21:31steve.dowersetstatus: open -> closed
resolution: not a bug
2014-11-25 06:20:27steve.dowersetmessages: + msg231638
2014-11-25 06:19:44steve.dowersetmessages: + msg231637
2014-11-25 05:46:26archi-pandeycreate