ZhangZhihui's Blog  

x = x + y

x += y

The two expressions have the same effect, but in the first case, x is reassigned to a new array, while in the second case, the values of array x are updated inplace.

Extensive use of inplace operators tends to impair code readability, and inplace operators should therefore be used only when necessary.

posted on 2020-06-10 15:01  ZhangZhihuiAAA  阅读(152)  评论(0编辑  收藏  举报