File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -184,10 +184,12 @@ msgstr ""
184
184
"型別幾乎影響物件行為的所有面向。就連物件識別性的重要性某種程度上也受型別影"
185
185
"響:對於不可變的型別,計算新數值的操作可能其實會回傳一個某個相同型別且相同數"
186
186
"值的現存物件的參照;對於可變型別這則不會發生。舉例來說,在進行 ``a = 1; b = "
187
- "1`` 之後,``a`` 和 ``b`` 可能會參照同一個物件,也可能不會,取決於所使用的實"
188
- "作;但在進行 ``c = []; d = []`` 之後,``c`` 和 ``d`` 則保證會參照兩個不同、獨"
189
- "特、且新建立的空白串列。(請注意,``c = d = []`` 則會將同一個物件同時指派給 "
190
- "``c`` 和 ``d``。)"
187
+ "1`` 之後,*a* 和 *b* 可能會參照同一個物件,也可能不會,取決於所使用的實作。這"
188
+ "是因為 :class:`int` 是不可變的型別,因此 ``1`` 的參照可以重複利用。這個行為取"
189
+ "決於所使用的實作,因此不應該依賴它,但在進行物件識別性測試的時候還是需要注意"
190
+ "有這件事情。而在進行 ``c = []; d = []`` 之後,*c* 和 *d* 則保證會參照兩個不"
191
+ "同、獨特、且新建立的空白串列。(請注意,``e = f = []`` 則會將同一個物件同時指"
192
+ "派給 *e* 和 *f*。)"
191
193
192
194
#: ../../reference/datamodel.rst:124
193
195
msgid "The standard type hierarchy"
You can’t perform that action at this time.
0 commit comments