in place functions from operator module

ernest nfdisco at
Sun Aug 29 16:44:47 CEST 2010


The operator module provides separate functions for
"in place" operations, such as iadd(), isub(), etc.
However, it appears that these functions don't really
do the operation in place:

In [34]: a = 4

In [35]: operator.iadd(a, 3)
Out[35]: 7

In [36]: a
Out[36]: 4

So, what's the point? If you have to make the
assignment yourself... I don't understand.


More information about the Python-list mailing list