@@ -2030,6 +2030,16 @@ msgid ""
2030
2030
"parameter names to annotations. The special key ``\" return\" `` is used to "
2031
2031
"report the function return value annotation (if any)."
2032
2032
msgstr ""
2033
+ "*args* は位置引数の名前のリストです。 *varargs* は ``*`` で始まる可変長位置引"
2034
+ "数の名前で、この引数を受け付けない場合は ``None`` です。 *varkw* は ``**`` で"
2035
+ "始まる可変長キーワード引数の名前で、この引数を受け付けない場合は ``None`` で"
2036
+ "す。 *defaults* は末尾 *n* 個の位置引数に対応するデフォルト引数の *n*-タプル"
2037
+ "で、 そのようなデフォルト値が定義されていない場合は ``None`` です。 "
2038
+ "*kwonlyargs* は宣言順に並んだキーワード専用引数の名前のリストです。 "
2039
+ "*kwonlydefaults* はそれらに対して値が渡されなかった場合の、 *kwonlyargs* の名"
2040
+ "前からデフォルト値へのマッピングを行う辞書です。 *annotations* 引数名からアノ"
2041
+ "テーションへのマッピングを行う辞書です。特殊キー ``\" return\" `` は (もしあれ"
2042
+ "ば) 関数の戻り値に対するアノテーションを伝えるために使われます。"
2033
2043
2034
2044
#: ../../library/inspect.rst:1165
2035
2045
msgid ""
@@ -2040,13 +2050,22 @@ msgid ""
2040
2050
"for use in code that needs to maintain compatibility with the Python 2 "
2041
2051
"``inspect`` module API."
2042
2052
msgstr ""
2053
+ ":func:`signature` と :ref:`Signature オブジェクト <inspect-signature-"
2054
+ "object>` が呼び出し可能オブジェクトのイントロスペクション (実行時オブジェクト"
2055
+ "調査) のための推奨される API を提供しており、かつ拡張モジュール API でときど"
2056
+ "き遭遇する追加の振る舞い (位置専用引数など) もサポートしていることに注意して"
2057
+ "ください。この関数は、主に Python 2 の ``inspect`` モジュール API との互換性"
2058
+ "を維持することが必要なコードで利用されるために残されています。"
2043
2059
2044
2060
#: ../../library/inspect.rst:1172
2045
2061
msgid ""
2046
2062
"This function is now based on :func:`signature`, but still ignores "
2047
2063
"``__wrapped__`` attributes and includes the already bound first parameter in "
2048
2064
"the signature output for bound methods."
2049
2065
msgstr ""
2066
+ "この関数は :func:`signature` をもとに実装されています。ただし、 "
2067
+ "``__wrapped__`` 属性を無視します。また、束縛されたメソッドに対するシグネチャ"
2068
+ "の出力において、すでに束縛された最初のパラメータを含みます。"
2050
2069
2051
2070
#: ../../library/inspect.rst:1177
2052
2071
msgid ""
@@ -2055,6 +2074,10 @@ msgid ""
2055
2074
"restore a clearly supported standard interface for single-source Python 2/3 "
2056
2075
"code migrating away from the legacy :func:`getargspec` API."
2057
2076
msgstr ""
2077
+ "Python 3.5 ではこのメソッドは非推奨とされ、代わりに :func:`signature` の利用"
2078
+ "が推奨されていました。ですが、レガシー API である :func:`getargspec` から移行"
2079
+ "し、明確にサポートされた標準インターフェースによる単一ソースでの Python 2/3 "
2080
+ "互換コードを復活させるため、非推奨の決定は取り消されました。"
2058
2081
2059
2082
#: ../../library/inspect.rst:1192
2060
2083
msgid ""
@@ -2072,7 +2095,7 @@ msgstr ""
2072
2095
2073
2096
#: ../../library/inspect.rst:1199 ../../library/inspect.rst:1209
2074
2097
msgid "This function was inadvertently marked as deprecated in Python 3.5."
2075
- msgstr ""
2098
+ msgstr "この関数は Python 3.5 において、不注意により非推奨とされていました。 "
2076
2099
2077
2100
#: ../../library/inspect.rst:1204
2078
2101
msgid ""
@@ -2107,6 +2130,14 @@ msgid ""
2107
2130
"exception of the same type and the same or similar message is raised. For "
2108
2131
"example:"
2109
2132
msgstr ""
2133
+ "*args* と *kwds* を、あたかもそれらをパラメータとして呼ばれたかのように、 "
2134
+ "Python 関数またはメソッド *func* に束縛します。また、第一引数 (通常 ``self`` "
2135
+ "という名前です) を関連するインスタンスに束縛します。引数名 (もし存在すれば "
2136
+ "``*`` や ``**`` で始まる引数も含む) を *args* および *kwds* で与えられた値に"
2137
+ "マッピングする辞書を返します。 *func* を不正に呼び出した場合、すなわち "
2138
+ "``func(*args, **kwds)`` の呼び出しが不完全なシグネチャにより例外を送出するよ"
2139
+ "うな場合は、同じ型の例外を同一またはよく似たメッセージとともに送出します。以"
2140
+ "下は使用例です:"
2110
2141
2111
2142
#: ../../library/inspect.rst:1231
2112
2143
msgid ""
@@ -2124,10 +2155,25 @@ msgid ""
2124
2155
"...\n"
2125
2156
"TypeError: f() missing 1 required positional argument: 'a'"
2126
2157
msgstr ""
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'"
2127
2171
2128
2172
#: ../../library/inspect.rst:1248
2129
2173
msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead."
2130
2174
msgstr ""
2175
+ "代わりに :meth:`Signature.bind` や :meth:`Signature.bind_partial` を使ってく"
2176
+ "ださい。"
2131
2177
2132
2178
#: ../../library/inspect.rst:1254
2133
2179
msgid ""
@@ -2152,6 +2198,8 @@ msgid ""
2152
2198
"Get the object wrapped by *func*. It follows the chain of :attr:"
2153
2199
"`__wrapped__` attributes returning the last object in the chain."
2154
2200
msgstr ""
2201
+ "*func* によりラップされたオブジェクトを取得します。 :attr:`__wrapped__` 属性"
2202
+ "の連鎖をたどり、ラップの連鎖の最後にあるオブジェクトを返します。"
2155
2203
2156
2204
#: ../../library/inspect.rst:1273
2157
2205
msgid ""
@@ -2165,23 +2213,27 @@ msgstr ""
2165
2213
2166
2214
#: ../../library/inspect.rst:1280
2167
2215
msgid ":exc:`ValueError` is raised if a cycle is encountered."
2168
- msgstr ""
2216
+ msgstr "循環を検知した場合は :exc:`ValueError` を送出します。 "
2169
2217
2170
2218
#: ../../library/inspect.rst:1287
2171
2219
msgid "Compute the annotations dict for an object."
2172
- msgstr ""
2220
+ msgstr "オブジェクトに対するアノテーション辞書を計算します。 "
2173
2221
2174
2222
#: ../../library/inspect.rst:1289
2175
2223
msgid ""
2176
2224
"This is an alias for :func:`annotationlib.get_annotations`; see the "
2177
2225
"documentation of that function for more information."
2178
2226
msgstr ""
2227
+ "これは :func:`annotationlib.get_annotations` のエイリアスです; 詳細はその関数"
2228
+ "のドキュメントを参照してください。"
2179
2229
2180
2230
#: ../../library/inspect.rst:1294
2181
2231
msgid ""
2182
2232
"This function is now an alias for :func:`annotationlib.get_annotations`. "
2183
2233
"Calling it as ``inspect.get_annotations`` will continue to work."
2184
2234
msgstr ""
2235
+ "この関数は :func:`annotationlib.get_annotations` のエイリアスになりました。 "
2236
+ "``inspect.get_annotations`` として呼び出しても、引き続き正しく動作します。"
2185
2237
2186
2238
#: ../../library/inspect.rst:1302
2187
2239
msgid "The interpreter stack"
0 commit comments