@@ -2030,6 +2030,16 @@ msgid ""
20302030"parameter names to annotations. The special key ``\" return\" `` is used to "
20312031"report the function return value annotation (if any)."
20322032msgstr ""
2033+ "*args* は位置引数の名前のリストです。 *varargs* は ``*`` で始まる可変長位置引"
2034+ "数の名前で、この引数を受け付けない場合は ``None`` です。 *varkw* は ``**`` で"
2035+ "始まる可変長キーワード引数の名前で、この引数を受け付けない場合は ``None`` で"
2036+ "す。 *defaults* は末尾 *n* 個の位置引数に対応するデフォルト引数の *n*-タプル"
2037+ "で、 そのようなデフォルト値が定義されていない場合は ``None`` です。 "
2038+ "*kwonlyargs* は宣言順に並んだキーワード専用引数の名前のリストです。 "
2039+ "*kwonlydefaults* はそれらに対して値が渡されなかった場合の、 *kwonlyargs* の名"
2040+ "前からデフォルト値へのマッピングを行う辞書です。 *annotations* 引数名からアノ"
2041+ "テーションへのマッピングを行う辞書です。特殊キー ``\" return\" `` は (もしあれ"
2042+ "ば) 関数の戻り値に対するアノテーションを伝えるために使われます。"
20332043
20342044#: ../../library/inspect.rst:1165
20352045msgid ""
@@ -2040,13 +2050,22 @@ msgid ""
20402050"for use in code that needs to maintain compatibility with the Python 2 "
20412051"``inspect`` module API."
20422052msgstr ""
2053+ ":func:`signature` と :ref:`Signature オブジェクト <inspect-signature-"
2054+ "object>` が呼び出し可能オブジェクトのイントロスペクション (実行時オブジェクト"
2055+ "調査) のための推奨される API を提供しており、かつ拡張モジュール API でときど"
2056+ "き遭遇する追加の振る舞い (位置専用引数など) もサポートしていることに注意して"
2057+ "ください。この関数は、主に Python 2 の ``inspect`` モジュール API との互換性"
2058+ "を維持することが必要なコードで利用されるために残されています。"
20432059
20442060#: ../../library/inspect.rst:1172
20452061msgid ""
20462062"This function is now based on :func:`signature`, but still ignores "
20472063"``__wrapped__`` attributes and includes the already bound first parameter in "
20482064"the signature output for bound methods."
20492065msgstr ""
2066+ "この関数は :func:`signature` をもとに実装されています。ただし、 "
2067+ "``__wrapped__`` 属性を無視します。また、束縛されたメソッドに対するシグネチャ"
2068+ "の出力において、すでに束縛された最初のパラメータを含みます。"
20502069
20512070#: ../../library/inspect.rst:1177
20522071msgid ""
@@ -2055,6 +2074,10 @@ msgid ""
20552074"restore a clearly supported standard interface for single-source Python 2/3 "
20562075"code migrating away from the legacy :func:`getargspec` API."
20572076msgstr ""
2077+ "Python 3.5 ではこのメソッドは非推奨とされ、代わりに :func:`signature` の利用"
2078+ "が推奨されていました。ですが、レガシー API である :func:`getargspec` から移行"
2079+ "し、明確にサポートされた標準インターフェースによる単一ソースでの Python 2/3 "
2080+ "互換コードを復活させるため、非推奨の決定は取り消されました。"
20582081
20592082#: ../../library/inspect.rst:1192
20602083msgid ""
@@ -2072,7 +2095,7 @@ msgstr ""
20722095
20732096#: ../../library/inspect.rst:1199 ../../library/inspect.rst:1209
20742097msgid "This function was inadvertently marked as deprecated in Python 3.5."
2075- msgstr ""
2098+ msgstr "この関数は Python 3.5 において、不注意により非推奨とされていました。 "
20762099
20772100#: ../../library/inspect.rst:1204
20782101msgid ""
@@ -2107,6 +2130,14 @@ msgid ""
21072130"exception of the same type and the same or similar message is raised. For "
21082131"example:"
21092132msgstr ""
2133+ "*args* と *kwds* を、あたかもそれらをパラメータとして呼ばれたかのように、 "
2134+ "Python 関数またはメソッド *func* に束縛します。また、第一引数 (通常 ``self`` "
2135+ "という名前です) を関連するインスタンスに束縛します。引数名 (もし存在すれば "
2136+ "``*`` や ``**`` で始まる引数も含む) を *args* および *kwds* で与えられた値に"
2137+ "マッピングする辞書を返します。 *func* を不正に呼び出した場合、すなわち "
2138+ "``func(*args, **kwds)`` の呼び出しが不完全なシグネチャにより例外を送出するよ"
2139+ "うな場合は、同じ型の例外を同一またはよく似たメッセージとともに送出します。以"
2140+ "下は使用例です:"
21102141
21112142#: ../../library/inspect.rst:1231
21122143msgid ""
@@ -2124,10 +2155,25 @@ msgid ""
21242155"...\n"
21252156"TypeError: f() missing 1 required positional argument: 'a'"
21262157msgstr ""
2158+ ">>> from inspect import getcallargs\n"
2159+ ">>> def f(a, b=1, *pos, **named):\n"
2160+ "... pass\n"
2161+ "...\n"
2162+ ">>> getcallargs(f, 1, 2, 3) == {'a': 1, 'named': {}, 'b': 2, 'pos': (3,)}\n"
2163+ "True\n"
2164+ ">>> getcallargs(f, a=2, x=4) == {'a': 2, 'named': {'x': 4}, 'b': 1, 'pos': "
2165+ "()}\n"
2166+ "True\n"
2167+ ">>> getcallargs(f)\n"
2168+ "Traceback (most recent call last):\n"
2169+ "...\n"
2170+ "TypeError: f() missing 1 required positional argument: 'a'"
21272171
21282172#: ../../library/inspect.rst:1248
21292173msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead."
21302174msgstr ""
2175+ "代わりに :meth:`Signature.bind` や :meth:`Signature.bind_partial` を使ってく"
2176+ "ださい。"
21312177
21322178#: ../../library/inspect.rst:1254
21332179msgid ""
@@ -2152,6 +2198,8 @@ msgid ""
21522198"Get the object wrapped by *func*. It follows the chain of :attr:"
21532199"`__wrapped__` attributes returning the last object in the chain."
21542200msgstr ""
2201+ "*func* によりラップされたオブジェクトを取得します。 :attr:`__wrapped__` 属性"
2202+ "の連鎖をたどり、ラップの連鎖の最後にあるオブジェクトを返します。"
21552203
21562204#: ../../library/inspect.rst:1273
21572205msgid ""
@@ -2165,23 +2213,27 @@ msgstr ""
21652213
21662214#: ../../library/inspect.rst:1280
21672215msgid ":exc:`ValueError` is raised if a cycle is encountered."
2168- msgstr ""
2216+ msgstr "循環を検知した場合は :exc:`ValueError` を送出します。 "
21692217
21702218#: ../../library/inspect.rst:1287
21712219msgid "Compute the annotations dict for an object."
2172- msgstr ""
2220+ msgstr "オブジェクトに対するアノテーション辞書を計算します。 "
21732221
21742222#: ../../library/inspect.rst:1289
21752223msgid ""
21762224"This is an alias for :func:`annotationlib.get_annotations`; see the "
21772225"documentation of that function for more information."
21782226msgstr ""
2227+ "これは :func:`annotationlib.get_annotations` のエイリアスです; 詳細はその関数"
2228+ "のドキュメントを参照してください。"
21792229
21802230#: ../../library/inspect.rst:1294
21812231msgid ""
21822232"This function is now an alias for :func:`annotationlib.get_annotations`. "
21832233"Calling it as ``inspect.get_annotations`` will continue to work."
21842234msgstr ""
2235+ "この関数は :func:`annotationlib.get_annotations` のエイリアスになりました。 "
2236+ "``inspect.get_annotations`` として呼び出しても、引き続き正しく動作します。"
21852237
21862238#: ../../library/inspect.rst:1302
21872239msgid "The interpreter stack"
0 commit comments