FW: Unexpexted behaviot of python operators on list

PANDEY2 Archana (MORPHO) archana.pandey.2 at morpho.com
Tue Nov 25 10:23:59 CET 2014


I hereby would like to share the problem I have found regarding python list implementation:-

As per python documentation python list is mutable data object.

That problem I found with the list is that is behaves differently when we use '+=' and '+'  '=' operators separately.
For example-
a=a+1 and a +=1  both behave in same way for all data types except python list

Please find the attached module and execute it on windows python32, See the difference in output.

Kind Regards

[cid:image001.png at 01D008BC.95CE3F20]

Syscom Corporation Limited

Morpho e-Documents Division

D-216, Sector 63, Noida,

Uttar Pradesh, 201301, India

Archana Pandey

Software Engineer-Payment/ID Noida
Tel: +91 (120) 4072 882

Mob: + 91 78 38 207 829

Mail: archana.pandey.2 at morpho.com<mailto:archana.pandey.2 at morpho.com>

" This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141125/a7cd2e7d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 6214 bytes
Desc: image001.png
URL: <http://mail.python.org/pipermail/python-list/attachments/20141125/a7cd2e7d/attachment.png>

More information about the Python-list mailing list