@@ -80,6 +80,9 @@ msgid ""
80
80
"context variables which prevents context variables from being properly "
81
81
"garbage collected."
82
82
msgstr ""
83
+ "**重要:** "
84
+ "コンテキスト変数は、モジュールのトップレベルで生成する必要があり、クロージャの中で作成すべきではありません。:class:`Context` "
85
+ "オブジェクトはコンテキスト変数への強参照を持っており、コンテキスト変数がガーベジコレクトされるのを防ぎます。"
83
86
84
87
#: ../../library/contextvars.rst:49
85
88
msgid "The name of the variable. This is a read-only property."
@@ -178,40 +181,46 @@ msgstr "現在の :class:`~contextvars.Context` オブジェクトのコピー
178
181
msgid ""
179
182
"The following snippet gets a copy of the current context and prints all "
180
183
"variables and their values that are set in it::"
181
- msgstr ""
184
+ msgstr "次のスニペットは、現在のコンテキストのコピーを取得し、コンテキストに設定されているすべての変数とその値を表示します:: "
182
185
183
186
#: ../../library/contextvars.rst:134
184
187
msgid ""
185
188
"The function has an O(1) complexity, i.e. works equally fast for contexts "
186
189
"with a few context variables and for contexts that have a lot of them."
187
190
msgstr ""
191
+ "この関数の複雑性はO(1) です。つまり、少数のコンテキスト変数を持つコンテキストと多くの変数を持つコンテキストで同程度の速度で動作します。"
188
192
189
193
#: ../../library/contextvars.rst:141
190
194
msgid "A mapping of :class:`ContextVars <ContextVar>` to their values."
191
- msgstr ""
195
+ msgstr ":class:`ContextVars` とその値の写像。 "
192
196
193
197
#: ../../library/contextvars.rst:143
194
198
msgid ""
195
199
"``Context()`` creates an empty context with no values in it. To get a copy "
196
200
"of the current context use the :func:`~contextvars.copy_context` function."
197
201
msgstr ""
202
+ "``Context()`` "
203
+ "は、値を持たない空のコンテキストを生成します。現在のコンテキストのコピーを得るには、:func:`~contextvars.copy_context` "
204
+ "関数を利用します。"
198
205
199
206
#: ../../library/contextvars.rst:147
200
207
msgid "Context implements the :class:`collections.abc.Mapping` interface."
201
- msgstr ""
208
+ msgstr "Context は、 :class:`collections.abc.Mapping` インタフェースを実装します。 "
202
209
203
210
#: ../../library/contextvars.rst:151
204
211
msgid ""
205
212
"Execute ``callable(*args, **kwargs)`` code in the context object the *run* "
206
213
"method is called on. Return the result of the execution or propagate an "
207
214
"exception if one occurred."
208
215
msgstr ""
216
+ "``callable(*args, **kwargs)`` を *run* "
217
+ "メソッドが呼ばれたコンテキストオブジェクトの中で実行します。実行した結果を返すか、例外が発生した場合はその例外を伝播します。"
209
218
210
219
#: ../../library/contextvars.rst:155
211
220
msgid ""
212
221
"Any changes to any context variables that *callable* makes will be contained"
213
222
" in the context object::"
214
- msgstr ""
223
+ msgstr "*callable* が行ったコンテキスト変数へのいかなる変更も、コンテキストオブジェクトに格納されます:: "
215
224
216
225
#: ../../library/contextvars.rst:184
217
226
msgid ""
@@ -221,7 +230,7 @@ msgstr ""
221
230
222
231
#: ../../library/contextvars.rst:190
223
232
msgid "Return a shallow copy of the context object."
224
- msgstr ""
233
+ msgstr "コンテキストオブジェクトの浅いコピーを返します。 "
225
234
226
235
#: ../../library/contextvars.rst:194
227
236
msgid ""
@@ -234,38 +243,42 @@ msgid ""
234
243
"Return the value of the *var* :class:`ContextVar` variable. If the variable "
235
244
"is not set in the context object, a :exc:`KeyError` is raised."
236
245
msgstr ""
246
+ ":class:`ContextVar` *var* "
247
+ "の値を返します。コンテキストオブジェクト内で変数が設定されていない場合は、:exc:`KeyError` を送出します。"
237
248
238
249
#: ../../library/contextvars.rst:205
239
250
msgid ""
240
251
"Return the value for *var* if *var* has the value in the context object. "
241
252
"Return *default* otherwise. If *default* is not given, return ``None``."
242
253
msgstr ""
254
+ "*var* がコンテキストオブジェクトの中に値を持てば、その値を返します。さもなければ、*default* を返します。*default* "
255
+ "を指定していなければ、``None`` を返します。"
243
256
244
257
#: ../../library/contextvars.rst:211
245
258
msgid "Return an iterator over the variables stored in the context object."
246
- msgstr ""
259
+ msgstr "コンテキストオブジェクトに格納されている変数群のイテレータを返します。 "
247
260
248
261
#: ../../library/contextvars.rst:216
249
262
msgid "Return the number of variables set in the context object."
250
- msgstr ""
263
+ msgstr "コンテキストオブジェクトに格納されている変数の数を返します。 "
251
264
252
265
#: ../../library/contextvars.rst:220
253
266
msgid "Return a list of all variables in the context object."
254
- msgstr ""
267
+ msgstr "コンテキストオブジェクト中のすべての変数のリストを返します。 "
255
268
256
269
#: ../../library/contextvars.rst:224
257
270
msgid "Return a list of all variables' values in the context object."
258
- msgstr ""
271
+ msgstr "コンテキストオブジェクト中のすべての変数の値のリストを返します。 "
259
272
260
273
#: ../../library/contextvars.rst:229
261
274
msgid ""
262
275
"Return a list of 2-tuples containing all variables and their values in the "
263
276
"context object."
264
- msgstr ""
277
+ msgstr "コンテキストオブジェクト中のすべての変数について、変数とその値からなる2要素のタプルのリストを返します。 "
265
278
266
279
#: ../../library/contextvars.rst:234
267
280
msgid "asyncio support"
268
- msgstr ""
281
+ msgstr "asyncioサポート "
269
282
270
283
#: ../../library/contextvars.rst:236
271
284
msgid ""
@@ -274,3 +287,5 @@ msgid ""
274
287
" server, that uses a context variable to make the address of a remote client"
275
288
" available in the Task that handles that client::"
276
289
msgstr ""
290
+ "コンテキスト変数は、追加の設定なしに :mod:`asyncio`をサポートします。例えば、次の単純なechoサーバーは、クライアントを扱う Task "
291
+ "の中でリモートクライアントのアドレスが利用できるように、コンテキスト変数を利用します::"
0 commit comments