@@ -16,7 +16,7 @@ msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.12\n "
1818"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 "
2020"PO-Revision-Date : 2021-06-28 00:52+0000\n "
2121"Last-Translator : TENMYO Masakazu, 2023\n "
2222"Language-Team : Japanese (https://app.transifex.com/python-doc/teams/5390/ "
@@ -2573,13 +2573,15 @@ msgstr ""
25732573
25742574#: ../../faq/programming.rst:1829
25752575msgid "When can I rely on identity tests with the *is* operator?"
2576- msgstr ""
2576+ msgstr "いつ *is* 演算子での同一性テストが頼れますか? "
25772577
25782578#: ../../faq/programming.rst:1831
25792579msgid ""
25802580"The ``is`` operator tests for object identity. The test ``a is b`` is "
25812581"equivalent to ``id(a) == id(b)``."
25822582msgstr ""
2583+ "``is`` 演算子はオブジェクトの同一性をテストします。 テスト ``a is b`` は "
2584+ "``id(a) == id(b)`` と同等です。"
25832585
25842586#: ../../faq/programming.rst:1834
25852587msgid ""
@@ -2588,33 +2590,48 @@ msgid ""
25882590"usually faster than equality tests. And unlike equality tests, identity "
25892591"tests are guaranteed to return a boolean ``True`` or ``False``."
25902592msgstr ""
2593+ "同一性テストの最も重要な特性は、オブジェクトは常にそれ自身と同一であり、 ``a "
2594+ "is a`` は常に ``True`` を返すということです。 同一性テストは通常、等価性テス"
2595+ "トよりも高速です。 また、等価性テストとは異なり、同一性テストは真偽値 "
2596+ "``True`` または``False`` を返すことが保証されています。"
25912597
25922598#: ../../faq/programming.rst:1839
25932599msgid ""
25942600"However, identity tests can *only* be substituted for equality tests when "
25952601"object identity is assured. Generally, there are three circumstances where "
25962602"identity is guaranteed:"
25972603msgstr ""
2604+ "ただし、同一性テストを等価性テストの代用とできるのは、オブジェクトの同一性が"
2605+ "保証されている場合 *のみ* です。 一般的に、同一性が保証される状況は3つありま"
2606+ "す:"
25982607
25992608#: ../../faq/programming.rst:1843
26002609msgid ""
26012610"1) Assignments create new names but do not change object identity. After "
26022611"the assignment ``new = old``, it is guaranteed that ``new is old``."
26032612msgstr ""
2613+ "1) 代入は新しい名前を作りますが、オブジェクトIDは変えません。 ``new = old`` "
2614+ "代入の後、 ``new is old`` が保証されます。"
26042615
26052616#: ../../faq/programming.rst:1846
26062617msgid ""
26072618"2) Putting an object in a container that stores object references does not "
26082619"change object identity. After the list assignment ``s[0] = x``, it is "
26092620"guaranteed that ``s[0] is x``."
26102621msgstr ""
2622+ "2) オブジェクト参照を格納するコンテナにオブジェクトを入れても、オブジェクトID"
2623+ "は変わりません。 ``s[0] = x`` リスト代入の後、 ``s[0] is x`` が保証されま"
2624+ "す。"
26112625
26122626#: ../../faq/programming.rst:1850
26132627msgid ""
26142628"3) If an object is a singleton, it means that only one instance of that "
26152629"object can exist. After the assignments ``a = None`` and ``b = None``, it "
26162630"is guaranteed that ``a is b`` because ``None`` is a singleton."
26172631msgstr ""
2632+ "3) オブジェクトがシングルトンなら、それはそのオブジェクトのインスタンスは1つ"
2633+ "だけ存在できることを意味します。 ``a = None`` と ``b = None`` 代入の後、 "
2634+ "``a is b`` が保証されます。``None`` がシングルトンのためです。"
26182635
26192636#: ../../faq/programming.rst:1854
26202637msgid ""
@@ -2623,16 +2640,22 @@ msgid ""
26232640"check constants such as :class:`int` and :class:`str` which aren't "
26242641"guaranteed to be singletons::"
26252642msgstr ""
2643+ "多くの他の状況では、同一性テストは賢明でなく、透過性テストをお勧めします。 "
2644+ "特に、シングルトンであることが保証されていない :class:`int` や :class:`str` "
2645+ "などの定数をチェックするために同一性テストを使わないでください。"
26262646
26272647#: ../../faq/programming.rst:1871
26282648msgid "Likewise, new instances of mutable containers are never identical::"
26292649msgstr ""
2650+ "同様に、ミュータブルなコンテナの新しいインスタンスは同一ではありません::"
26302651
26312652#: ../../faq/programming.rst:1878
26322653msgid ""
26332654"In the standard library code, you will see several common patterns for "
26342655"correctly using identity tests:"
26352656msgstr ""
2657+ "標準ライブラリのコードには、同一性テストを正しく使うための一般的なパターンが"
2658+ "あります:"
26362659
26372660#: ../../faq/programming.rst:1881
26382661msgid ""
@@ -2641,6 +2664,9 @@ msgid ""
26412664"confusion with other objects that may have boolean values that evaluate to "
26422665"false."
26432666msgstr ""
2667+ "1) :pep:`8` で推奨されるように、同一性テストは ``None`` のチェックの良い方法"
2668+ "です。 コードの中で平易な英語のように読めますし、 false と評価される真偽値を"
2669+ "持ちうる他のオブジェクトとの混同を避けます。"
26442670
26452671#: ../../faq/programming.rst:1885
26462672msgid ""
@@ -2649,19 +2675,27 @@ msgid ""
26492675"guaranteed to be distinct from other objects. For example, here is how to "
26502676"implement a method that behaves like :meth:`dict.pop`::"
26512677msgstr ""
2678+ "2) ``None`` が有効な入力値である場合、省略された引数を検出にはコツがいりま"
2679+ "す。 そのような状況では、他のオブジェクトと区別されることが保証されたシング"
2680+ "ルトンの番兵オブジェクトを作れます。 例えば、これは :meth:`dict.pop` のよう"
2681+ "に振る舞うメソッドを実装する方法です:"
26522682
26532683#: ../../faq/programming.rst:1901
26542684msgid ""
26552685"3) Container implementations sometimes need to augment equality tests with "
26562686"identity tests. This prevents the code from being confused by objects such "
26572687"as ``float('NaN')`` that are not equal to themselves."
26582688msgstr ""
2689+ "3) コンテナの実装では、等価性テストを同一性テストで補強しないといけない場合が"
2690+ "あります。 これは、 ``float('NaN')`` のような自分自身と等価でないオブジェク"
2691+ "トによってコードが混乱するのを防ぐためです。"
26592692
26602693#: ../../faq/programming.rst:1905
26612694msgid ""
26622695"For example, here is the implementation of :meth:`!collections.abc.Sequence."
26632696"__contains__`::"
26642697msgstr ""
2698+ "例えば、これは :meth:`!collections.abc.Sequence.__contains__`: の実装です:"
26652699
26662700#: ../../faq/programming.rst:1916
26672701msgid ""
0 commit comments