@@ -16,7 +16,7 @@ msgid ""
16
16
msgstr ""
17
17
"Project-Id-Version : Python 3.12\n "
18
18
"Report-Msgid-Bugs-To : \n "
19
- "POT-Creation-Date : 2023-10-20 14:13 +0000\n "
19
+ "POT-Creation-Date : 2023-10-27 14:49 +0000\n "
20
20
"PO-Revision-Date : 2021-06-28 00:52+0000\n "
21
21
"Last-Translator : TENMYO Masakazu, 2023\n "
22
22
"Language-Team : Japanese (https://app.transifex.com/python-doc/teams/5390/ "
@@ -2573,13 +2573,15 @@ msgstr ""
2573
2573
2574
2574
#: ../../faq/programming.rst:1829
2575
2575
msgid "When can I rely on identity tests with the *is* operator?"
2576
- msgstr ""
2576
+ msgstr "いつ *is* 演算子での同一性テストが頼れますか? "
2577
2577
2578
2578
#: ../../faq/programming.rst:1831
2579
2579
msgid ""
2580
2580
"The ``is`` operator tests for object identity. The test ``a is b`` is "
2581
2581
"equivalent to ``id(a) == id(b)``."
2582
2582
msgstr ""
2583
+ "``is`` 演算子はオブジェクトの同一性をテストします。 テスト ``a is b`` は "
2584
+ "``id(a) == id(b)`` と同等です。"
2583
2585
2584
2586
#: ../../faq/programming.rst:1834
2585
2587
msgid ""
@@ -2588,33 +2590,48 @@ msgid ""
2588
2590
"usually faster than equality tests. And unlike equality tests, identity "
2589
2591
"tests are guaranteed to return a boolean ``True`` or ``False``."
2590
2592
msgstr ""
2593
+ "同一性テストの最も重要な特性は、オブジェクトは常にそれ自身と同一であり、 ``a "
2594
+ "is a`` は常に ``True`` を返すということです。 同一性テストは通常、等価性テス"
2595
+ "トよりも高速です。 また、等価性テストとは異なり、同一性テストは真偽値 "
2596
+ "``True`` または``False`` を返すことが保証されています。"
2591
2597
2592
2598
#: ../../faq/programming.rst:1839
2593
2599
msgid ""
2594
2600
"However, identity tests can *only* be substituted for equality tests when "
2595
2601
"object identity is assured. Generally, there are three circumstances where "
2596
2602
"identity is guaranteed:"
2597
2603
msgstr ""
2604
+ "ただし、同一性テストを等価性テストの代用とできるのは、オブジェクトの同一性が"
2605
+ "保証されている場合 *のみ* です。 一般的に、同一性が保証される状況は3つありま"
2606
+ "す:"
2598
2607
2599
2608
#: ../../faq/programming.rst:1843
2600
2609
msgid ""
2601
2610
"1) Assignments create new names but do not change object identity. After "
2602
2611
"the assignment ``new = old``, it is guaranteed that ``new is old``."
2603
2612
msgstr ""
2613
+ "1) 代入は新しい名前を作りますが、オブジェクトIDは変えません。 ``new = old`` "
2614
+ "代入の後、 ``new is old`` が保証されます。"
2604
2615
2605
2616
#: ../../faq/programming.rst:1846
2606
2617
msgid ""
2607
2618
"2) Putting an object in a container that stores object references does not "
2608
2619
"change object identity. After the list assignment ``s[0] = x``, it is "
2609
2620
"guaranteed that ``s[0] is x``."
2610
2621
msgstr ""
2622
+ "2) オブジェクト参照を格納するコンテナにオブジェクトを入れても、オブジェクトID"
2623
+ "は変わりません。 ``s[0] = x`` リスト代入の後、 ``s[0] is x`` が保証されま"
2624
+ "す。"
2611
2625
2612
2626
#: ../../faq/programming.rst:1850
2613
2627
msgid ""
2614
2628
"3) If an object is a singleton, it means that only one instance of that "
2615
2629
"object can exist. After the assignments ``a = None`` and ``b = None``, it "
2616
2630
"is guaranteed that ``a is b`` because ``None`` is a singleton."
2617
2631
msgstr ""
2632
+ "3) オブジェクトがシングルトンなら、それはそのオブジェクトのインスタンスは1つ"
2633
+ "だけ存在できることを意味します。 ``a = None`` と ``b = None`` 代入の後、 "
2634
+ "``a is b`` が保証されます。``None`` がシングルトンのためです。"
2618
2635
2619
2636
#: ../../faq/programming.rst:1854
2620
2637
msgid ""
@@ -2623,16 +2640,22 @@ msgid ""
2623
2640
"check constants such as :class:`int` and :class:`str` which aren't "
2624
2641
"guaranteed to be singletons::"
2625
2642
msgstr ""
2643
+ "多くの他の状況では、同一性テストは賢明でなく、透過性テストをお勧めします。 "
2644
+ "特に、シングルトンであることが保証されていない :class:`int` や :class:`str` "
2645
+ "などの定数をチェックするために同一性テストを使わないでください。"
2626
2646
2627
2647
#: ../../faq/programming.rst:1871
2628
2648
msgid "Likewise, new instances of mutable containers are never identical::"
2629
2649
msgstr ""
2650
+ "同様に、ミュータブルなコンテナの新しいインスタンスは同一ではありません::"
2630
2651
2631
2652
#: ../../faq/programming.rst:1878
2632
2653
msgid ""
2633
2654
"In the standard library code, you will see several common patterns for "
2634
2655
"correctly using identity tests:"
2635
2656
msgstr ""
2657
+ "標準ライブラリのコードには、同一性テストを正しく使うための一般的なパターンが"
2658
+ "あります:"
2636
2659
2637
2660
#: ../../faq/programming.rst:1881
2638
2661
msgid ""
@@ -2641,6 +2664,9 @@ msgid ""
2641
2664
"confusion with other objects that may have boolean values that evaluate to "
2642
2665
"false."
2643
2666
msgstr ""
2667
+ "1) :pep:`8` で推奨されるように、同一性テストは ``None`` のチェックの良い方法"
2668
+ "です。 コードの中で平易な英語のように読めますし、 false と評価される真偽値を"
2669
+ "持ちうる他のオブジェクトとの混同を避けます。"
2644
2670
2645
2671
#: ../../faq/programming.rst:1885
2646
2672
msgid ""
@@ -2649,19 +2675,27 @@ msgid ""
2649
2675
"guaranteed to be distinct from other objects. For example, here is how to "
2650
2676
"implement a method that behaves like :meth:`dict.pop`::"
2651
2677
msgstr ""
2678
+ "2) ``None`` が有効な入力値である場合、省略された引数を検出にはコツがいりま"
2679
+ "す。 そのような状況では、他のオブジェクトと区別されることが保証されたシング"
2680
+ "ルトンの番兵オブジェクトを作れます。 例えば、これは :meth:`dict.pop` のよう"
2681
+ "に振る舞うメソッドを実装する方法です:"
2652
2682
2653
2683
#: ../../faq/programming.rst:1901
2654
2684
msgid ""
2655
2685
"3) Container implementations sometimes need to augment equality tests with "
2656
2686
"identity tests. This prevents the code from being confused by objects such "
2657
2687
"as ``float('NaN')`` that are not equal to themselves."
2658
2688
msgstr ""
2689
+ "3) コンテナの実装では、等価性テストを同一性テストで補強しないといけない場合が"
2690
+ "あります。 これは、 ``float('NaN')`` のような自分自身と等価でないオブジェク"
2691
+ "トによってコードが混乱するのを防ぐためです。"
2659
2692
2660
2693
#: ../../faq/programming.rst:1905
2661
2694
msgid ""
2662
2695
"For example, here is the implementation of :meth:`!collections.abc.Sequence."
2663
2696
"__contains__`::"
2664
2697
msgstr ""
2698
+ "例えば、これは :meth:`!collections.abc.Sequence.__contains__`: の実装です:"
2665
2699
2666
2700
#: ../../faq/programming.rst:1916
2667
2701
msgid ""
0 commit comments