
如果
somefunction返回可变值,它们不一定会一样工作。考虑:
>>> def somefunction():... return []... >>> x = y = somefunction()>>> x.append(4)>>> x[4]>>> y[4]>>> x = somefunction(); y = somefunction()>>> x.append(3)>>> x[3]>>> y[]
欢迎分享,转载请注明来源:内存溢出

如果
somefunction返回可变值,它们不一定会一样工作。考虑:
>>> def somefunction():... return []... >>> x = y = somefunction()>>> x.append(4)>>> x[4]>>> y[4]>>> x = somefunction(); y = somefunction()>>> x.append(3)>>> x[3]>>> y[]
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)