首页 > 编程语言 > 详细

Python - Inplace Operator

时间:2020-06-10 15:09:32      阅读:48      评论:0      收藏:0      [点我收藏+]

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.

Python - Inplace Operator

原文:https://www.cnblogs.com/zhangzhihui/p/13085226.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!