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.

Author devkapilbansal
Recipients devkapilbansal
Date 2021-09-26.12:13:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632658439.55.0.347636093536.issue45293@roundup.psfhosted.org>
In-reply-to
Content
Hi,

I tried addition and in-place addition on a list.

>>> l = ['a', 'b', 'c']

>>> l = l + 'de' (raises an error)

>>> l += 'de'
>>> print(l)
['a', 'b' , 'c', 'd', 'e']

I want to ask why the behaviour of both these are different?? If it is done intentionally, then it should be there in the documentation but I am not able to find any reference.
History
Date User Action Args
2021-09-26 12:13:59devkapilbansalsetrecipients: + devkapilbansal
2021-09-26 12:13:59devkapilbansalsetmessageid: <1632658439.55.0.347636093536.issue45293@roundup.psfhosted.org>
2021-09-26 12:13:59devkapilbansallinkissue45293 messages
2021-09-26 12:13:59devkapilbansalcreate