[docs] Code not working

Berker Peksağ berker.peksag at gmail.com
Fri Jan 12 16:32:02 EST 2018


On Fri, Jan 12, 2018 at 5:21 PM, Pushergene via docs <docs at python.org> wrote:
> Hey,
> The code in
> https://docs.python.org/3/library/operator.html#inplace-operators is not
> working.
> Its confusing, please change it... python 3.6.4

Can you give us a little bit more details? Both snippet work for me:

>>> from operator import iadd
>>> a = 'hello'
>>> iadd(a, ' world')
'hello world'
>>> s = ['h', 'e', 'l', 'l', 'o']
>>> iadd(s, [' ', 'w', 'o', 'r', 'l', 'd'])
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']
>>> s
['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']

--Berker


More information about the docs mailing list