66# Translators:
77# Shun Sakurai, 2017
88# Nozomu Kaneko <nozom.kaneko@gmail.com>, 2017
9+ # E. Kawashima, 2017
910# Masato HASHIMOTO <cabezon.hashimoto@gmail.com>, 2017
1011# Naoki INADA <songofacandy@gmail.com>, 2017
1112# 秘湯 <xwhhsprings@gmail.com>, 2017
12- # E. Kawashima, 2017
1313# Arihiro TAKASE, 2017
1414# tomo, 2018
1515#
@@ -1684,7 +1684,7 @@ msgid ""
16841684"equality. Such types will need to customize their comparison behavior, and "
16851685"in fact, a number of built-in types have done that."
16861686msgstr ""
1687- "同一でないインスタンスは常に等価でないとする等価性比較のデフォルトの振る舞いは 、型が必要とするオブジェクトの値や値に基づいた等価性の実用的な定義とは対照的に思えるでしょう。\n"
1687+ "同一でないインスタンスは常に等価でないとする等価比較のデフォルトの振る舞いは 、型が必要とするオブジェクトの値や値に基づいた等価性の実用的な定義とは対照的に思えるでしょう。\n"
16881688"そのような型では比較の振る舞いをカスタマイズする必要が出てきて、実際にたくさんの組み込み型でそれが行われています。"
16891689
16901690#: ../../reference/expressions.rst:1411
@@ -1702,7 +1702,7 @@ msgid ""
17021702"involved, they compare mathematically (algorithmically) correct without loss"
17031703" of precision."
17041704msgstr ""
1705- "いくつかの組み込みの数値型 (:ref:`typesnumeric`) と標準ライブラリの型 :class:`fractions.Fraction` および :class:`decimal.Decimal` は、同じ型や別の型どうしで比較できますが 、複素数では順序比較がサポートされていないという制限があります。\n"
1705+ "いくつかの組み込みの数値型 (:ref:`typesnumeric`) と標準ライブラリの型 :class:`fractions.Fraction` および :class:`decimal.Decimal` は、これらの型の範囲で異なる型とも比較できますが 、複素数では順序比較がサポートされていないという制限があります。\n"
17061706"関わる型の制限の範囲内では、精度のロス無しに数学的に (アルゴリズム的に) 正しい比較が行われます。"
17071707
17081708#: ../../reference/expressions.rst:1421
@@ -1714,24 +1714,33 @@ msgid ""
17141714" 3``, ``x == x``, ``x != x`` are all false. This behavior is compliant with"
17151715" IEEE 754."
17161716msgstr ""
1717+ "非数値である ``float('NaN')`` と ``decimal.Decimal('NaN')`` は特別です。\n"
1718+ "数と非数値との任意の順序比較は偽です。\n"
1719+ "直観に反する帰結として、非数値は自分自身と等価ではないことになります。\n"
1720+ "例えば ``x = float('NaN')`` ならば、 ``3 < x``, ``x < 3``, ``x == x``, ``x != x`` は全て偽です。\n"
1721+ "この振る舞いは IEEE 754 に従ったものです。"
17171722
17181723#: ../../reference/expressions.rst:1427
17191724msgid ""
17201725"Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be "
17211726"compared within and across their types. They compare lexicographically "
17221727"using the numeric values of their elements."
17231728msgstr ""
1729+ "バイナリシーケンス (:class:`bytes` または :class:`bytearray` のインスタンス) は、これらの型の範囲で異なる型とも比較できます。\n"
1730+ "比較は要素の数としての値を使った辞書式順序で行われます。"
17241731
17251732#: ../../reference/expressions.rst:1431
17261733msgid ""
17271734"Strings (instances of :class:`str`) compare lexicographically using the "
17281735"numerical Unicode code points (the result of the built-in function "
17291736":func:`ord`) of their characters. [#]_"
17301737msgstr ""
1738+ "文字列 (:class:`str` のインスタンス) の比較は、文字の Unicode のコードポイントの数としての値 (組み込み関数 "
1739+ ":func:`ord` の返り値) を使った辞書式順序で行われます。 [#]_"
17311740
17321741#: ../../reference/expressions.rst:1435
17331742msgid "Strings and binary sequences cannot be directly compared."
1734- msgstr ""
1743+ msgstr "文字列とバイナリシーケンスは直接には比較できません。 "
17351744
17361745#: ../../reference/expressions.rst:1437
17371746msgid ""
@@ -1741,12 +1750,14 @@ msgid ""
17411750"types results in inequality, and ordering comparison across these types "
17421751"raises :exc:`TypeError`."
17431752msgstr ""
1753+ "シーケンス (:class:`tuple`, :class:`list`, or :class:`range` のインスタンス) の比較は、同じ型どうしでしか行えず、 range は順序比較をサポートしていません。\n"
1754+ "異なる型どうしの等価比較の結果は等価でないとなり、異なる型どうしの順序比較は :exc:`TypeError` を送出します。"
17441755
17451756#: ../../reference/expressions.rst:1443
17461757msgid ""
17471758"Sequences compare lexicographically using comparison of corresponding "
17481759"elements, whereby reflexivity of the elements is enforced."
1749- msgstr ""
1760+ msgstr "シーケンスの比較は、要素の反射性があるものとして、対応する要素どうしの比較を使って辞書式順序で行われます。 "
17501761
17511762#: ../../reference/expressions.rst:1446
17521763msgid ""
@@ -1760,6 +1771,10 @@ msgid ""
17601771"not-a-number values for example result in the following comparison behavior "
17611772"when used in a list::"
17621773msgstr ""
1774+ "要素の反射性が強制されていると、コレクションの比較ではコレクションの要素 ``x`` に対して ``x == x`` が常に真だと仮定します。\n"
1775+ "この仮定に基づいて、最初に要素の同一性が比較され、同一でない要素どうしに対してのみ要素の比較が行われます。\n"
1776+ "この手法は、比較される要素が反射的な場合、厳密な要素比較と同じ結果をもたらします。\n"
1777+ "反射的でない要素では厳密な要素比較と異なる結果になり、驚くかもしれません: 例えば、反射的でない非数値がリストで使われたとき、比較の振る舞いは次のような結果になります::"
17631778
17641779#: ../../reference/expressions.rst:1464
17651780msgid ""
@@ -1783,6 +1798,8 @@ msgid ""
17831798"shorter collection is ordered first (for example, ``[1,2] < [1,2,3]`` is "
17841799"true)."
17851800msgstr ""
1801+ "順序比較をサポートしているコレクションの順序は、最初の等価でない要素の順序と同じになります (例えば、 ``[1,2,x] <= [1,2,y]`` は ``x <= y``と同じ値になります)。\n"
1802+ "対応する要素が存在しない場合、短い方のコレクションの方が先の順序となります (例えば、 ``[1,2] < [1,2,3]`` は真です)。"
17861803
17871804#: ../../reference/expressions.rst:1477
17881805msgid ""
@@ -1791,18 +1808,19 @@ msgid ""
17911808"enforces reflexivity."
17921809msgstr ""
17931810"マッピング (:class:`dict` のインスタンス) の比較の結果が等価となるのは、同じ `(key, value)` を持っているときかつそのときに限ります。\n"
1794- "キーと値の等価性比較では反射性が強制されます 。"
1811+ "キーと値の等価比較では反射性が強制されます 。"
17951812
17961813#: ../../reference/expressions.rst:1481
17971814msgid ""
17981815"Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`."
1799- msgstr ""
1816+ msgstr "順序比較 (``<``, ``>``, ``<=``, ``>=``) は :exc:`TypeError` を送出します。 "
18001817
18011818#: ../../reference/expressions.rst:1483
18021819msgid ""
18031820"Sets (instances of :class:`set` or :class:`frozenset`) can be compared "
18041821"within and across their types."
18051822msgstr ""
1823+ "集合 (:class:`set` または :class:`frozenset` のインスタンス) の比較は、これらの型の範囲で異なる型とも行えます。"
18061824
18071825#: ../../reference/expressions.rst:1486
18081826msgid ""
@@ -1814,16 +1832,19 @@ msgid ""
18141832":func:`max`, and :func:`sorted` produce undefined results given a list of "
18151833"sets as inputs)."
18161834msgstr ""
1835+ "集合には、部分集合あるいは上位集合かどうかを基準とする順序比較が定義されています。\n"
1836+ "この関係は全順序を定義しません (例えば、 ``{1,2}`` と ``{2,3}`` という2つの集合は片方がもう一方の部分集合でもなく上位集合でもありません)。\n"
1837+ "従って、集合は全順序性に依存する関数の引数として適切ではありません (例えば、 :func:`min`, :func:`max`, :func:`sorted` は集合のリストを入力として与えると未定義な結果となります)。"
18171838
18181839#: ../../reference/expressions.rst:1494
18191840msgid "Comparison of sets enforces reflexivity of its elements."
1820- msgstr ""
1841+ msgstr "集合の比較では、その要素の反射性が強制されます。 "
18211842
18221843#: ../../reference/expressions.rst:1496
18231844msgid ""
18241845"Most other built-in types have no comparison methods implemented, so they "
18251846"inherit the default comparison behavior."
1826- msgstr ""
1847+ msgstr "他の組み込み型のほとんどは比較メソッドが実装されておらず、デフォルトの比較の振る舞いを継承します。 "
18271848
18281849#: ../../reference/expressions.rst:1499
18291850msgid ""
@@ -1841,14 +1862,14 @@ msgstr ""
18411862
18421863#: ../../reference/expressions.rst:1505
18431864msgid "``x is y`` implies ``x == y``"
1844- msgstr "``x is y`` は暗黙的に ``x == y``"
1865+ msgstr "``x is y`` ならば ``x == y``"
18451866
18461867#: ../../reference/expressions.rst:1507
18471868msgid ""
18481869"Comparison should be symmetric. In other words, the following expressions "
18491870"should have the same result:"
18501871msgstr ""
1851- "比較は対称でなければなりません 。\n"
1872+ "比較は対称的でなければなりません 。\n"
18521873"つまり、以下の式の結果は同じでなければなりません:"
18531874
18541875#: ../../reference/expressions.rst:1510
@@ -1877,11 +1898,11 @@ msgstr ""
18771898
18781899#: ../../reference/expressions.rst:1521
18791900msgid "``x > y and y > z`` implies ``x > z``"
1880- msgstr "``x > y and y > z`` は暗黙的に ``x > z``"
1901+ msgstr "``x > y and y > z`` ならば ``x > z``"
18811902
18821903#: ../../reference/expressions.rst:1523
18831904msgid "``x < y and y <= z`` implies ``x < z``"
1884- msgstr "``x < y and y <= z`` は暗黙的に ``x < z``"
1905+ msgstr "``x < y and y <= z`` ならば ``x < z``"
18851906
18861907#: ../../reference/expressions.rst:1525
18871908msgid ""
@@ -1909,7 +1930,7 @@ msgid ""
19091930"sequences, but not to sets or mappings). See also the "
19101931":func:`~functools.total_ordering` decorator."
19111932msgstr ""
1912- "最後の2式は全順序の集まりに適用されます (たとえばシーケンスには適用されますがセットやマッピングには適用されません )。\n"
1933+ "最後の2式は全順序コレクションに当てはまります (たとえばシーケンスには当てはまりますが、集合やマッピングには当てはまりません )。\n"
19131934":func:`~functools.total_ordering` デコレータも参照してください。"
19141935
19151936#: ../../reference/expressions.rst:1538
@@ -1925,10 +1946,12 @@ msgid ""
19251946"Python does not enforce these consistency rules. In fact, the not-a-number "
19261947"values are an example for not following these rules."
19271948msgstr ""
1949+ "Python はこの一貫性規則を強制しません。\n"
1950+ "事実、非数値がこの規則に従わない例となります。"
19281951
19291952#: ../../reference/expressions.rst:1551
19301953msgid "Membership test operations"
1931- msgstr "帰属検査演算 "
1954+ msgstr "所属検査演算 "
19321955
19331956#: ../../reference/expressions.rst:1553
19341957msgid ""
@@ -1940,6 +1963,11 @@ msgid ""
19401963"types such as list, tuple, set, frozenset, dict, or collections.deque, the "
19411964"expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``."
19421965msgstr ""
1966+ "演算子 :keyword:`in` および :keyword:`not in` は所属関係を調べます。\n"
1967+ "``x in s`` の評価は、 *x* が *s* の要素であれば ``True`` となり、そうでなければ ``False`` となります。\n"
1968+ "``x not in s`` は ``x in s`` の否定を返します。\n"
1969+ "すべての組み込みのシーケンス型と集合型に加えて、辞書も :keyword:`!in` を辞書が与えられたキーを持っているかを調べる演算子としてサポートしています。\n"
1970+ "リスト、タプル、集合、凍結集合、辞書、 collections.deque のようなコンテナ型において、式 ``x in y`` は ``any(x is e or x == e for e in y)`` と等価です。"
19431971
19441972#: ../../reference/expressions.rst:1561
19451973msgid ""
@@ -1980,6 +2008,10 @@ msgid ""
19802008"indices do not raise :exc:`IndexError` exception. (If any other exception "
19812009"is raised, it is as if :keyword:`in` raised that exception)."
19822010msgstr ""
2011+ "最終的には、旧スタイルの反復プロトコルの実行を試みます: もしクラスが :meth:`__getitem__` を定義しているならば、 ``x in "
2012+ "y`` は ``x == y[i]`` となるような非負整数のインデックス *i* が存在するとき、かつそのときにかぎり ``True`` "
2013+ "となります。インデックス *i* が負である場合に :exc:`IndexError` 例外が送出されることはありません。 "
2014+ "(他の何らかの例外が送出された場合、例外は :keyword:`in` から送出されたかのようになります)。"
19832015
19842016#: ../../reference/expressions.rst:1587
19852017msgid ""
@@ -1998,6 +2030,9 @@ msgid ""
19982030"identity is determined using the :meth:`id` function. ``x is not y`` yields"
19992031" the inverse truth value. [#]_"
20002032msgstr ""
2033+ "演算子 :keyword:`is` および :keyword:`is not` は、オブジェクトの同一性に対するテストを行います: ``x is y`` は、 *x* と *y* が同じオブジェクトを指すとき、かつそのときに限り真になります。\n"
2034+ "オブジェクトの同一性は :meth:`id` 関数を使って判定されます。\n"
2035+ "``x is not y`` は :keyword:`is` の真値を反転したものになります。 [#]_"
20012036
20022037#: ../../reference/expressions.rst:1614
20032038msgid "Boolean operations"
@@ -2013,9 +2048,9 @@ msgid ""
20132048"objects can customize their truth value by providing a :meth:`__bool__` "
20142049"method."
20152050msgstr ""
2016- "ブール演算のコンテキストや、式が制御フロー文中で使われる際には、以下の値 : ``False`` 、 ``None`` すべての型における数値の "
2017- "0、空の文字列、空のコンテナ (文字列、タプル、リスト、辞書、集合、凍結集合など) は偽 (false) であると解釈されます。それ以外の値は真 "
2018- "(true) であると解釈されます。ユーザ定義のメソッドは 、 :meth:`__bool__` メソッドを与えることで、真理値をカスタマイズできます 。"
2051+ "ブール演算のコンテキストや、式が制御フローの文で使われる際には、次の値は偽だと解釈されます : ``False`` 、 ``None`` 、 すべての型における数値の 0、空の文字列、空のコンテナ (文字列、タプル、リスト、辞書、集合、凍結集合など)。\n "
2052+ "それ以外の値は真だと解釈されます。\n "
2053+ "ユーザ定義のオブジェクトは 、 :meth:`__bool__` メソッドを与えることで、真偽値をカスタマイズできます 。"
20192054
20202055#: ../../reference/expressions.rst:1634
20212056msgid ""
@@ -2052,6 +2087,9 @@ msgid ""
20522087" argument (for example, ``not 'foo'`` produces ``False`` rather than "
20532088"``''``.)"
20542089msgstr ""
2090+ "なお、 :keyword:`and` も :keyword:`or` も、返す値を ``True`` や ``False`` に制限せず、最後に評価した引数を返します。\n"
2091+ "この仕様が便利なときもあります。例えば ``s`` が文字列で、空文字列ならデフォルトの値に置き換えたいとき、式 ``s or 'foo'`` は望んだ値を与えます。\n"
2092+ ":keyword:`not` は必ず新しい値を作成するので、引数の型に関係なくブール値を返します (例えば、 ``not 'foo'`` は ``''`` ではなく ``False`` になります)。"
20552093
20562094#: ../../reference/expressions.rst:1659
20572095msgid "Conditional expressions"
@@ -2087,6 +2125,9 @@ msgid ""
20872125" a function object. The unnamed object behaves like a function object "
20882126"defined with:"
20892127msgstr ""
2128+ "ラムダ式 (ラムダ形式とも呼ばれます) は無名関数を作成するのに使います。\n"
2129+ "式 ``lambda parameters: expression`` は関数オブジェクトになります。\n"
2130+ "この無名オブジェクトは以下に定義されている関数オブジェクト同様に動作します:"
20902131
20912132#: ../../reference/expressions.rst:1707
20922133msgid ""
@@ -2174,7 +2215,7 @@ msgid ""
21742215"the :ref:`comparisons` section."
21752216msgstr ""
21762217":ref:`comparisons` "
2177- "節で述べられているように、比較、帰属 、同一性のテストは全てが同じ優先順位を持っていて、左から右に連鎖するという特徴を持っていることに注意してください。"
2218+ "節で述べられているように、比較、所属 、同一性のテストは全てが同じ優先順位を持っていて、左から右に連鎖するという特徴を持っていることに注意してください。"
21782219
21792220#: ../../reference/expressions.rst:1796
21802221msgid "Operator"
@@ -2234,7 +2275,7 @@ msgstr ""
22342275
22352276#: ../../reference/expressions.rst:1808
22362277msgid "Comparisons, including membership tests and identity tests"
2237- msgstr "帰属や同一性のテストを含む比較 "
2278+ msgstr "所属や同一性のテストを含む比較 "
22382279
22392280#: ../../reference/expressions.rst:1812
22402281msgid "``|``"
0 commit comments