@@ -1297,7 +1297,6 @@ msgstr ""
1297
1297
"::"
1298
1298
1299
1299
#: ../../faq/programming.rst:836
1300
- #, fuzzy
1301
1300
msgid ""
1302
1301
"then integer division has to return the floor. C also requires that "
1303
1302
"identity to hold, and then compilers that truncate ``i // j`` need to make "
@@ -2811,20 +2810,17 @@ msgstr ""
2811
2810
"要檢查其 id 的物件仍然存在,請建立對該物件的另一個引用:"
2812
2811
2813
2812
#: ../../faq/programming.rst:1829
2814
- #, fuzzy
2815
2813
msgid "When can I rely on identity tests with the *is* operator?"
2816
2814
msgstr "我什麼時候可以依靠 *is* 運算子進行識別性測試?"
2817
2815
2818
2816
#: ../../faq/programming.rst:1831
2819
- #, fuzzy
2820
2817
msgid ""
2821
2818
"The ``is`` operator tests for object identity. The test ``a is b`` is "
2822
2819
"equivalent to ``id(a) == id(b)``."
2823
2820
msgstr ""
2824
2821
"``is`` 運算子測試物件識別性。測試 ``a is b`` 等同於 ``id(a) == id(b)`` 。"
2825
2822
2826
2823
#: ../../faq/programming.rst:1834
2827
- #, fuzzy
2828
2824
msgid ""
2829
2825
"The most important property of an identity test is that an object is always "
2830
2826
"identical to itself, ``a is a`` always returns ``True``. Identity tests are "
@@ -2836,7 +2832,6 @@ msgstr ""
2836
2832
"``True`` 或 ``False`` 。"
2837
2833
2838
2834
#: ../../faq/programming.rst:1839
2839
- #, fuzzy
2840
2835
msgid ""
2841
2836
"However, identity tests can *only* be substituted for equality tests when "
2842
2837
"object identity is assured. Generally, there are three circumstances where "
@@ -2846,15 +2841,13 @@ msgstr ""
2846
2841
"證識別性的情況有以下三種:"
2847
2842
2848
2843
#: ../../faq/programming.rst:1843
2849
- #, fuzzy
2850
2844
msgid ""
2851
2845
"1) Assignments create new names but do not change object identity. After "
2852
2846
"the assignment ``new = old``, it is guaranteed that ``new is old``."
2853
2847
msgstr ""
2854
2848
"1) 賦值建立新名稱但不改變物件識別性。賦值``new = old``後,保證``new is old``。"
2855
2849
2856
2850
#: ../../faq/programming.rst:1846
2857
- #, fuzzy
2858
2851
msgid ""
2859
2852
"2) Putting an object in a container that stores object references does not "
2860
2853
"change object identity. After the list assignment ``s[0] = x``, it is "
@@ -2874,7 +2867,6 @@ msgstr ""
2874
2867
"和 ``b = None`` 之後,可以保證 ``a is b`` 因為 ``None`` 是單例。"
2875
2868
2876
2869
#: ../../faq/programming.rst:1854
2877
- #, fuzzy
2878
2870
msgid ""
2879
2871
"In most other circumstances, identity tests are inadvisable and equality "
2880
2872
"tests are preferred. In particular, identity tests should not be used to "
@@ -2895,14 +2887,12 @@ msgstr ""
2895
2887
"::"
2896
2888
2897
2889
#: ../../faq/programming.rst:1878
2898
- #, fuzzy
2899
2890
msgid ""
2900
2891
"In the standard library code, you will see several common patterns for "
2901
2892
"correctly using identity tests:"
2902
2893
msgstr "在標準函式庫程式碼中,你將看到幾種正確使用識別性測試的常見模式:"
2903
2894
2904
2895
#: ../../faq/programming.rst:1881
2905
- #, fuzzy
2906
2896
msgid ""
2907
2897
"1) As recommended by :pep:`8`, an identity test is the preferred way to "
2908
2898
"check for ``None``. This reads like plain English in code and avoids "
@@ -2927,7 +2917,6 @@ msgstr ""
2927
2917
"::"
2928
2918
2929
2919
#: ../../faq/programming.rst:1901
2930
- #, fuzzy
2931
2920
msgid ""
2932
2921
"3) Container implementations sometimes need to augment equality tests with "
2933
2922
"identity tests. This prevents the code from being confused by objects such "
@@ -3398,7 +3387,6 @@ msgstr ""
3398
3387
"::"
3399
3388
3400
3389
#: ../../faq/programming.rst:2210
3401
- #, fuzzy
3402
3390
msgid ""
3403
3391
"The nature of the problem is made clear if you print out the \" identity\" of "
3404
3392
"the class objects::"
0 commit comments