GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-docs-ja/library/concurrent.interpreters.po at 3.14 · python/python-docs-ja Expand file tree/ Copy pathconcurrent.interpreters.poMore file actions 721 lines (624 loc) · 30.5 KB / Copy pathconcurrent.interpreters.poFile metadata and controls721 lines (624 loc) · 30.5 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 # SOME DESCRIPTIVE TITLE. # Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # # Translators: # python-doc bot, 2025 # Takanori Suzuki <[email protected]>, 2025 # Rafael Fontenelle <[email protected]>, 2026 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.15\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-10-13 19:59+0000\n" "PO-Revision-Date: 2025-09-16 00:01+0000\n" "Last-Translator: Rafael Fontenelle <[email protected]>, 2026\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" msgid "" ":mod:`!concurrent.interpreters` --- Multiple interpreters in the same process" msgstr "" ":mod:`!concurrent.interpreters` --- 同じプロセス内の複数のインタープリタ" msgid "**Source code:** :source:`Lib/concurrent/interpreters`" msgstr "**ソースコード:** :source:`Lib/concurrent/interpreters`" msgid "" "The :mod:`!concurrent.interpreters` module constructs higher-level " "interfaces on top of the lower level :mod:`!_interpreters` module." msgstr "" ":mod:`!concurrent.interpreters` モジュールは、低水準の :mod:`!_interpreters` " "モジュールの上に、より高水準のインターフェースを構築します。" msgid "" "The module is primarily meant to provide a basic API for managing " "interpreters (AKA \"subinterpreters\") and running things in them. Running " "mostly involves switching to an interpreter (in the current thread) and " "calling a function in that execution context." msgstr "" "このモジュールの主な目的は、インタープリタ (「サブインタープリタ」とも呼ばれ" "ます) の管理と、その中での実行のための基本的な API を提供することです。\n" "実行時には主に、現在のスレッドでインタープリタを切り替え、その実行コンテキス" "トで関数を呼び出します。" msgid "" "For concurrency, interpreters themselves (and this module) don't provide " "much more than isolation, which on its own isn't useful. Actual concurrency " "is available separately through :mod:`threads <threading>` -- see `below " "<interp-concurrency_>`_." msgstr "" "並行処理に関しては、インタープリタ自体 (およびこのモジュール) が提供するのは" "ほぼ分離だけであり、それだけでは役に立ちません。\n" "実際の並行処理は、別途 :mod:`スレッド <threading>` によって利用できます。\n" "`後述の説明 <interp-concurrency_>`_ を参照してください。" msgid ":class:`~concurrent.futures.InterpreterPoolExecutor`" msgstr ":class:`~concurrent.futures.InterpreterPoolExecutor`" msgid "Combines threads with interpreters in a familiar interface." msgstr "" "使い慣れたインターフェースで、スレッドとインタープリタを組み合わせます。" msgid ":ref:`isolating-extensions-howto`" msgstr ":ref:`isolating-extensions-howto`" msgid "How to update an extension module to support multiple interpreters." msgstr "複数のインタープリタをサポートするように拡張モジュールを更新する方法。" msgid ":pep:`554`" msgstr ":pep:`554`" #: ../../library/concurrent.interpreters.rst:38 msgid ":pep:`734`" msgstr ":pep:`734`" msgid ":pep:`684`" msgstr ":pep:`684`" msgid "Availability" msgstr "利用可能な環境" #: ../../includes/wasm-notavail.rst:5 msgid "" "This module does not work or is not available on WebAssembly. See :ref:`wasm-" "availability` for more information." msgstr "" "このモジュールは WebAssembly では動作しないか、利用不可です。詳しく" "は、:ref:`wasm-availability` を見てください。" msgid "Key details" msgstr "主な注意点" msgid "" "Before we dive in further, there are a small number of details to keep in " "mind about using multiple interpreters:" msgstr "" "詳しい説明に入る前に、複数のインタープリタの使用について留意すべき点を挙げま" "す:" msgid "`isolated <interp-isolation_>`_, by default" msgstr "デフォルトで `分離される <interp-isolation_>`_" msgid "no implicit threads" msgstr "暗黙にスレッドは作成されない" msgid "not all PyPI packages support use in multiple interpreters yet" msgstr "" "PyPI のすべてのパッケージが、複数のインタープリタでの使用をサポートしているわ" "けではない" #: ../../library/concurrent.interpreters.rst:63 msgid "Introduction" msgstr "はじめに" msgid "" "An \"interpreter\" is effectively the execution context of the Python " "runtime. It contains all of the state the runtime needs to execute a " "program. This includes things like the import state and builtins. (Each " "thread, even if there's only the main thread, has some extra runtime state, " "in addition to the current interpreter, related to the current exception and " "the bytecode eval loop.)" msgstr "" "「インタープリタ」は、実質的に Python ランタイムの実行コンテキストです。\n" "プログラムの実行に必要な状態をすべて含んでいます。\n" "これには、インポートの状態や組み込みオブジェクトなどが含まれます。\n" "(メインスレッドしかない場合でも、各スレッドには現在のインタープリタの状態に加" "え、現在の例外やバイトコードの評価ループに関する実行時の状態があります)。" #: ../../library/concurrent.interpreters.rst:72 msgid "" "The concept and functionality of the interpreter have been a part of Python " "since version 2.2, but the feature was only available through the C-API and " "not well known, and the `isolation <interp-isolation_>`_ was relatively " "incomplete until version 3.12." msgstr "" msgid "Multiple Interpreters and Isolation" msgstr "複数のインタープリタと分離" msgid "" "A Python implementation may support using multiple interpreters in the same " "process. CPython has this support. Each interpreter is effectively " "isolated from the others (with a limited number of carefully managed process-" "global exceptions to the rule)." msgstr "" "Python の実装は、同じプロセス内で複数のインタープリタを使うことをサポートする" "場合があります。\n" "CPython はこれをサポートしています。\n" "各インタープリタは、他のインタープリタから実質的に分離されています (プロセス" "全体で共有されるものに、慎重に管理された少数の例外があります)。" msgid "" "That isolation is primarily useful as a strong separation between distinct " "logical components of a program, where you want to have careful control of " "how those components interact." msgstr "" "この分離は主に、プログラムを構成する別々の論理的な部分を明確に切り離し、それ" "らのやり取りを慎重に制御したい場合に役立ちます。" msgid "" "Interpreters in the same process can technically never be strictly isolated " "from one another since there are few restrictions on memory access within " "the same process. The Python runtime makes a best effort at isolation but " "extension modules may easily violate that. Therefore, do not use multiple " "interpreters in security-sensitive situations, where they shouldn't have " "access to each other's data." msgstr "" "同じプロセス内ではメモリアクセスに対する制限がほとんどないため、技術的には、" "同じプロセス内のインタープリタを互いに厳密に分離することはできません。\n" "Python ランタイムは可能な限り分離しますが、拡張モジュールは容易にその分離を破" "ることができます。\n" "したがって、互いのデータにアクセスできてはならないような、セキュリティが重要" "な状況では、複数のインタープリタを使わないでください。" msgid "Running in an Interpreter" msgstr "インタープリタ内での実行" msgid "" "Running in a different interpreter involves switching to it in the current " "thread and then calling some function. The runtime will execute the " "function using the current interpreter's state. The :mod:`!" "concurrent.interpreters` module provides a basic API for creating and " "managing interpreters, as well as the switch-and-call operation." msgstr "" "別のインタープリタ内で実行するには、現在のスレッドでそのインタープリタに切り" "替えてから、関数を呼び出します。\n" "ランタイムは、現在のインタープリタの状態を使って関数を実行します。\n" ":mod:`!concurrent.interpreters` モジュールは、インタープリタを作成・管理する" "基本的な API と、この切り替えと呼び出しの操作を提供します。" msgid "" "No other threads are automatically started for the operation. There is `a " "helper <interp-call-in-thread_>`_ for that though. There is another " "dedicated helper for calling the builtin :func:`exec` in an interpreter." msgstr "" "この操作で、他のスレッドが自動的に開始されることはありません。\n" "ただし、そのための `補助機能 <interp-call-in-thread_>`_ があります。\n" "インタープリタ内で組み込みの :func:`exec` を呼び出すための専用の補助機能もあ" "ります。" msgid "" "When :func:`exec` (or :func:`eval`) are called in an interpreter, they run " "using the interpreter's :mod:`!__main__` module as the \"globals\" " "namespace. The same is true for functions that aren't associated with any " "module. This is the same as how scripts invoked from the command-line run " "in the :mod:`!__main__` module." msgstr "" "インタープリタ内で :func:`exec` (または :func:`eval`) を呼び出すと、そのイン" "タープリタの :mod:`!__main__` モジュールを「グローバル」名前空間として実行し" "ます。\n" "どのモジュールにも関連付けられていない関数も同様です。\n" "これは、コマンドラインから起動したスクリプトが :mod:`!__main__` モジュール内" "で動作するのと同じです。" msgid "Concurrency and Parallelism" msgstr "並行処理と並列処理" msgid "" "As noted earlier, interpreters do not provide any concurrency on their own. " "They strictly represent the isolated execution context the runtime will use " "*in the current thread*. That isolation makes them similar to processes, " "but they still enjoy in-process efficiency, like threads." msgstr "" "前述のとおり、インタープリタ自体は並行処理を提供しません。\n" "厳密には、ランタイムが *現在のスレッドで* 使う、分離された実行コンテキストを" "表すものです。\n" "その分離はプロセスに似ていますが、スレッドと同様に、同じプロセス内にあること" "による効率のよさも得られます。" msgid "" "All that said, interpreters do naturally support certain flavors of " "concurrency. There's a powerful side effect of that isolation. It enables a " "different approach to concurrency than you can take with async or threads. " "It's a similar concurrency model to CSP or the actor model, a model which is " "relatively easy to reason about." msgstr "" "とはいえ、インタープリタは特定の形態の並行処理を自然にサポートします。\n" "分離には強力な副次効果があり、async やスレッドとは異なる並行処理の手法が可能" "になります。\n" "その並行処理モデルは CSP やアクターモデルに似ており、比較的理解しやすいもので" "す。" msgid "" "You can take advantage of that concurrency model in a single thread, " "switching back and forth between interpreters, Stackless-style. However, " "this model is more useful when you combine interpreters with multiple " "threads. This mostly involves starting a new thread, where you switch to " "another interpreter and run what you want there." msgstr "" "単一のスレッドでも、Stackless のようにインタープリタを行き来して、この並行処" "理モデルを活用できます。\n" "しかし、このモデルはインタープリタと複数のスレッドを組み合わせたときに、より" "役立ちます。\n" "主な手順は、新しいスレッドを起動し、その中で別のインタープリタに切り替えて、" "必要な処理を実行することです。" msgid "" "Each actual thread in Python, even if you're only running in the main " "thread, has its own *current* execution context. Multiple threads can use " "the same interpreter or different ones." msgstr "" "メインスレッドだけで実行している場合でも、Python の各実スレッドには、それぞれ" "の *現在の* 実行コンテキストがあります。\n" "複数のスレッドで同じインタープリタを使うことも、別々のインタープリタを使うこ" "ともできます。" msgid "" "At a high level, you can think of the combination of threads and " "interpreters as threads with opt-in sharing." msgstr "" "大まかには、スレッドとインタープリタの組み合わせを、明示的に選んだものだけを" "共有するスレッドと考えることができます。" msgid "" "As a significant bonus, interpreters are sufficiently isolated that they do " "not share the :term:`GIL`, which means combining threads with multiple " "interpreters enables full multi-core parallelism. (This has been the case " "since Python 3.12.)" msgstr "" "大きな利点として、インタープリタは :term:`GIL` を共有しないほど十分に分離され" "ています。\n" "そのため、スレッドと複数のインタープリタを組み合わせると、複数コアでの完全な" "並列実行が可能になります。\n" "(Python 3.12 以降はこのようになっています)。" msgid "Communication Between Interpreters" msgstr "インタープリタ間の通信" msgid "" "In practice, multiple interpreters are useful only if we have a way to " "communicate between them. This usually involves some form of message " "passing, but can even mean sharing data in some carefully managed way." msgstr "" "実際には、複数のインタープリタが役立つのは、それらの間で通信する手段がある場" "合だけです。\n" "通常は何らかのメッセージパッシングを使いますが、慎重に管理した方法でデータを" "共有する場合もあります。" msgid "" "With this in mind, the :mod:`!concurrent.interpreters` module provides " "a :class:`queue.Queue` implementation, available " "through :func:`create_queue`." msgstr "" "このため、:mod:`!concurrent.interpreters` モジュールは :class:`queue.Queue` " "の実装を提供しており、:func:`create_queue` で利用できます。" msgid "\"Sharing\" Objects" msgstr "オブジェクトの「共有」" msgid "" "Any data actually shared between interpreters loses the thread-safety " "provided by the :term:`GIL`. There are various options for dealing with " "this in extension modules. However, from Python code the lack of thread-" "safety means objects can't actually be shared, with a few exceptions. " "Instead, a copy must be created, which means mutable objects won't stay in " "sync." msgstr "" "インタープリタ間で実際に共有されるデータは、:term:`GIL` が提供するスレッド" "セーフ性を失います。\n" "拡張モジュールでは、これに対処するための選択肢がいくつかあります。\n" "しかし、Python コードでは、スレッドセーフ性がないため、ごく一部の例外を除いて" "オブジェクトを実際に共有することはできません。\n" "代わりにコピーを作成しなければならないため、ミュータブルなオブジェクトの同期" "は保たれません。" msgid "" "By default, most objects are copied with :mod:`pickle` when they are passed " "to another interpreter. Nearly all of the immutable builtin objects are " "either directly shared or copied efficiently. For example:" msgstr "" "デフォルトでは、ほとんどのオブジェクトは別のインタープリタに渡す際" "に :mod:`pickle` でコピーされます。\n" "イミュータブルな組み込みオブジェクトのほぼすべては、直接共有されるか、効率よ" "くコピーされます。\n" "例えば、次のものがあります:" #: ../../library/concurrent.interpreters.rst:186 msgid ":const:`None`" msgstr ":const:`None`" msgid ":class:`bool` (:const:`True` and :const:`False`)" msgstr ":class:`bool` (:const:`True` と :const:`False`)" #: ../../library/concurrent.interpreters.rst:188 msgid ":class:`bytes`" msgstr ":class:`bytes`" #: ../../library/concurrent.interpreters.rst:189 msgid ":class:`str`" msgstr ":class:`str`" #: ../../library/concurrent.interpreters.rst:190 msgid ":class:`int`" msgstr ":class:`int`" #: ../../library/concurrent.interpreters.rst:191 msgid ":class:`float`" msgstr ":class:`float`" msgid ":class:`tuple` (of similarly supported objects)" msgstr ":class:`tuple` (同様にサポートされているオブジェクトを要素とするもの)" msgid "" "There are a small number of Python types that actually share mutable data " "between interpreters:" msgstr "" "インタープリタ間で実際にミュータブルなデータを共有する Python の型も、少数で" "すが存在します:" #: ../../library/concurrent.interpreters.rst:197 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" #: ../../library/concurrent.interpreters.rst:198 msgid ":class:`Queue`" msgstr ":class:`Queue`" #: ../../library/concurrent.interpreters.rst:202 msgid "Reference" msgstr "リファレンス" #: ../../library/concurrent.interpreters.rst:204 msgid "This module defines the following functions:" msgstr "このモジュールは以下の関数を定義しています:" msgid "" "Return a :class:`list` of :class:`Interpreter` objects, one for each " "existing interpreter." msgstr "" "既存の各インタープリタに対応する :class:`Interpreter` オブジェクト" "の :class:`list` を返します。" msgid "" "Return an :class:`Interpreter` object for the currently running interpreter." msgstr "" "現在実行中のインタープリタの :class:`Interpreter` オブジェクトを返します。" msgid "" "Return an :class:`Interpreter` object for the main interpreter. This is the " "interpreter the runtime created to run the :term:`REPL` or the script given " "at the command-line. It is usually the only one." msgstr "" "メインインタープリタの :class:`Interpreter` オブジェクトを返します。\n" "これは、:term:`REPL` またはコマンドラインで指定されたスクリプトを実行するため" "に、ランタイムが作成したインタープリタです。\n" "通常は、これが唯一のインタープリタです。" msgid "" "Initialize a new (idle) Python interpreter and return a :class:`Interpreter` " "object for it." msgstr "" "新しい (実行中でない) Python インタープリタを初期化し、そ" "の :class:`Interpreter` オブジェクトを返します。" msgid "" "Initialize a new cross-interpreter queue and return a :class:`Queue` object " "for it." msgstr "" "インタープリタ間で使う新しいキューを初期化し、その :class:`Queue` オブジェク" "トを返します。" msgid "" "*maxsize* is an integer that sets the upperbound limit on the number of " "items that can be placed in the queue. Insertion will be blocked once this " "size has been reached, until queue items are consumed. If *maxsize* is less " "than or equal to zero, the queue size is infinite." msgstr "" "*maxsize* は、キューに入れられる要素数の上限を設定する整数です。\n" "このサイズに達すると、キューの要素が取り出されるまで挿入はブロックされま" "す。\n" "*maxsize* が 0 以下の場合、キューのサイズに上限はありません。" msgid "Interpreter objects" msgstr "インタープリタオブジェクト" msgid "A single interpreter in the current process." msgstr "現在のプロセス内の一つのインタープリタです。" msgid "" "Generally, :class:`Interpreter` shouldn't be called directly. Instead, " "use :func:`create` or one of the other module functions." msgstr "" "通常、:class:`Interpreter` を直接呼び出すべきではありません。\n" "代わりに :func:`create` または他のモジュール関数を使ってください。" msgid "(read-only)" msgstr "(読み出し専用)" msgid "The underlying interpreter's ID." msgstr "基となるインタープリタの ID です。" msgid "A string describing where the interpreter came from." msgstr "インタープリタがどこから作成されたかを表す文字列です。" msgid "" "Return ``True`` if the interpreter is currently executing code in its :mod:`!" "__main__` module and ``False`` otherwise." msgstr "" "インタープリタが現在 :mod:`!__main__` モジュール内でコードを実行している場合" "は ``True``、それ以外の場合は ``False`` を返します。" msgid "Finalize and destroy the interpreter." msgstr "インタープリタの終了処理を行い、破棄します。" msgid "Bind objects in the interpreter's :mod:`!__main__` module." msgstr "" "インタープリタの :mod:`!__main__` モジュール内にオブジェクトを束縛します。" msgid "" "Some objects are actually shared and some are copied efficiently, but most " "are copied via :mod:`pickle`. See :ref:`interp-object-sharing`." msgstr "" "一部のオブジェクトは実際に共有され、効率よくコピーされるものもありますが、ほ" "とんどは :mod:`pickle` を介してコピーされます。\n" ":ref:`interp-object-sharing` を参照してください。" msgid "Run the given source code in the interpreter (in the current thread)." msgstr "" "指定されたソースコードを、現在のスレッドでそのインタープリタ内で実行します。" msgid "" "Return the result of running the given function in the interpreter (in the " "current thread)." msgstr "" "指定された関数を、現在のスレッドでそのインタープリタ内で実行した結果を返しま" "す。" msgid "Run the given function in the interpreter (in a new thread)." msgstr "指定された関数を、新しいスレッドでそのインタープリタ内で実行します。" #: ../../library/concurrent.interpreters.rst:291 msgid "Exceptions" msgstr "例外" msgid "" "This exception, a subclass of :exc:`Exception`, is raised when an " "interpreter-related error happens." msgstr "" ":exc:`Exception` のサブクラスで、インタープリタに関するエラーが発生した場合に" "送出されます。" msgid "" "This exception, a subclass of :exc:`InterpreterError`, is raised when the " "targeted interpreter no longer exists." msgstr "" ":exc:`InterpreterError` のサブクラスで、対象のインタープリタがすでに存在しな" "い場合に送出されます。" msgid "" "This exception, a subclass of :exc:`InterpreterError`, is raised when the " "running code raised an uncaught exception." msgstr "" ":exc:`InterpreterError` のサブクラスで、実行中のコードが捕捉されない例外を送" "出した場合に送出されます。" msgid "A basic snapshot of the exception raised in the other interpreter." msgstr "別のインタープリタで送出された例外の基本的なスナップショットです。" msgid "" "This exception, a subclass of :exc:`TypeError`, is raised when an object " "cannot be sent to another interpreter." msgstr "" ":exc:`TypeError` のサブクラスで、オブジェクトを別のインタープリタに送れない場" "合に送出されます。" msgid "Communicating Between Interpreters" msgstr "インタープリタ間での通信" msgid "" "A wrapper around a low-level, cross-interpreter queue, which implements all " "the methods of :class:`queue.Queue` except " "for :meth:`~queue.Queue.task_done`, :meth:`~queue.Queue.join` " "and :meth:`~queue.Queue.shutdown`. The underlying queue can only be created " "through :func:`create_queue`." msgstr "" "インタープリタ間で使う低水準のキューのラッパです。\n" ":class:`queue.Queue` のメソッドのう" "ち、:meth:`~queue.Queue.task_done`、:meth:`~queue.Queue.join`、:meth:`~queue.Queue.shutdown` " "を除くすべてを実装しています。\n" "基となるキューを作成できるのは :func:`create_queue` だけです。" msgid "The queue's ID." msgstr "キューの ID です。" #: ../../library/concurrent.interpreters.rst:342 msgid "Return the number of items in the queue." msgstr "キュー内の要素数を返します。" #: ../../library/concurrent.interpreters.rst:346 msgid "Return ``True`` if the queue is empty, ``False`` otherwise." msgstr "キューが空ならば ``True`` を、そうでなければ ``False`` を返します。" msgid "Return ``True`` if the queue is full, ``False`` otherwise." msgstr "" "キューがいっぱいの場合は ``True``、それ以外の場合は ``False`` を返します。" msgid "" "Put *obj* into the queue. If optional args *block* is true and *timeout* is " "``None`` (the default), block if necessary until a free slot is available. " "If *timeout* is a positive number, it blocks at most *timeout* seconds and " "raises the :exc:`QueueFull` exception if no free slot was available within " "that time. Otherwise (*block* is false), put an object on the queue if a " "free slot is immediately available, else raise the :exc:`QueueFull` " "exception (*timeout* is ignored in that case)." msgstr "" "*obj* をキューに入れます。\n" "オプション引数 *block* が真で、*timeout* が ``None`` (デフォルト) の場合、必" "要に応じて空きができるまでブロックします。\n" "*timeout* が正の数の場合、最大 *timeout* 秒ブロックし、その間に空きができなけ" "れば :exc:`QueueFull` 例外を送出します。\n" "それ以外の場合 (*block* が偽の場合)、直ちに利用できる空きがあればオブジェクト" "をキューに入れ、なければ :exc:`QueueFull` 例外を送出します (この場合、" "*timeout* は無視されます)。" msgid "Equivalent to ``put(obj, block=False)``." msgstr "``put(obj, block=False)`` と等価です。" msgid "" "Remove and return an object from the queue. If optional args *block* is " "true and *timeout* is ``None`` (the default), block if necessary until an " "object is available. If *timeout* is a positive number, it blocks at most " "*timeout* seconds and raises the :exc:`QueueEmpty` exception if no object " "was available within that time. Otherwise (*block* is false), return an " "object if one is immediately available, else raise the :exc:`QueueEmpty` " "exception (*timeout* is ignored in that case)." msgstr "" "キューからオブジェクトを取り出して返します。\n" "オプション引数 *block* が真で、*timeout* が ``None`` (デフォルト) の場合、必" "要に応じてオブジェクトが利用できるまでブロックします。\n" "*timeout* が正の数の場合、最大 *timeout* 秒ブロックし、その間にオブジェクトが" "利用できなければ :exc:`QueueEmpty` 例外を送出します。\n" "それ以外の場合 (*block* が偽の場合)、直ちに利用できるオブジェクトがあればそれ" "を返し、なければ :exc:`QueueEmpty` 例外を送出します (この場合、*timeout* は無" "視されます)。" msgid "Equivalent to ``get(block=False)``." msgstr "``get(block=False)`` と等価です。" msgid "" "This exception, a subclass of :exc:`queue.Empty`, is raised " "from :meth:`Queue.get` and :meth:`Queue.get_nowait` when the queue is empty." msgstr "" ":exc:`queue.Empty` のサブクラスで、キューが空の場合に :meth:`Queue.get` " "と :meth:`Queue.get_nowait` から送出されます。" msgid "" "This exception, a subclass of :exc:`queue.Full`, is raised " "from :meth:`Queue.put` and :meth:`Queue.put_nowait` when the queue is full." msgstr "" ":exc:`queue.Full` のサブクラスで、キューがいっぱいの場合に :meth:`Queue.put` " "と :meth:`Queue.put_nowait` から送出されます。" #: ../../library/concurrent.interpreters.rst:397 msgid "Basic usage" msgstr "基本的な使い方" msgid "Creating an interpreter and running code in it::" msgstr "インタープリタを作成し、その中でコードを実行する例。 ::" msgid "" "from concurrent import interpreters\n" "\n" "interp = interpreters.create()\n" "\n" "# Run in the current OS thread.\n" "\n" "interp.exec('print(\"spam!\")')\n" "\n" "interp.exec(\"\"\"if True:\n" " print('spam!')\n" " \"\"\")\n" "\n" "from textwrap import dedent\n" "interp.exec(dedent(\"\"\"\n" " print('spam!')\n" " \"\"\"))\n" "\n" "def run(arg):\n" " return arg\n" "\n" "res = interp.call(run, 'spam!')\n" "print(res)\n" "\n" "def run():\n" " print('spam!')\n" "\n" "interp.call(run)\n" "\n" "# Run in new OS thread.\n" "\n" "t = interp.call_in_thread(run)\n" "t.join()" msgstr "" "from concurrent import interpreters\n" "\n" "interp = interpreters.create()\n" "\n" "# 現在の OS スレッドで実行する\n" "\n" "interp.exec('print(\"spam!\")')\n" "\n" "interp.exec(\"\"\"if True:\n" " print('spam!')\n" " \"\"\")\n" "\n" "from textwrap import dedent\n" "interp.exec(dedent(\"\"\"\n" " print('spam!')\n" " \"\"\"))\n" "\n" "def run(arg):\n" " return arg\n" "\n" "res = interp.call(run, 'spam!')\n" "print(res)\n" "\n" "def run():\n" " print('spam!')\n" "\n" "interp.call(run)\n" "\n" "# 新しい OS スレッドで実行する\n" "\n" "t = interp.call_in_thread(run)\n" "t.join()" msgid "Communicating between interpreters with a queue::" msgstr "キューを使ってインタープリタ間で通信する例。 ::" msgid "" "from concurrent import interpreters\n" "\n" "interp = interpreters.create()\n" "queue = interpreters.create_queue()\n" "\n" "def worker(queue):\n" " queue.put('spam!')\n" "\n" "t = interp.call_in_thread(worker, queue)\n" "print(queue.get())\n" "t.join()" msgstr "" "from concurrent import interpreters\n" "\n" "interp = interpreters.create()\n" "queue = interpreters.create_queue()\n" "\n" "def worker(queue):\n" " queue.put('spam!')\n" "\n" "t = interp.call_in_thread(worker, queue)\n" "print(queue.get())\n" "t.join()" |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |