|
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: Python 3.14\n" |
9 | 9 | "Report-Msgid-Bugs-To: \n" |
10 | | -"POT-Creation-Date: 2026-09-02 00:20+0000\n" |
| 10 | +"POT-Creation-Date: 2026-10-14 00:18+0000\n" |
11 | 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
12 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
13 | 13 | "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" |
@@ -357,137 +357,188 @@ msgid "" |
357 | 357 | "for it." |
358 | 358 | msgstr "" |
359 | 359 |
|
360 | | -#: ../../library/concurrent.interpreters.rst:237 |
361 | | -msgid "Interpreter objects" |
| 360 | +#: ../../library/concurrent.interpreters.rst:235 |
| 361 | +msgid "" |
| 362 | +"*maxsize* is an integer that sets the upperbound limit on the number of " |
| 363 | +"items that can be placed in the queue. Insertion will be blocked once this " |
| 364 | +"size has been reached, until queue items are consumed. If *maxsize* is less " |
| 365 | +"than or equal to zero, the queue size is infinite." |
362 | 366 | msgstr "" |
363 | 367 |
|
364 | 368 | #: ../../library/concurrent.interpreters.rst:241 |
| 369 | +msgid "Interpreter objects" |
| 370 | +msgstr "" |
| 371 | + |
| 372 | +#: ../../library/concurrent.interpreters.rst:245 |
365 | 373 | msgid "A single interpreter in the current process." |
366 | 374 | msgstr "" |
367 | 375 |
|
368 | | -#: ../../library/concurrent.interpreters.rst:243 |
| 376 | +#: ../../library/concurrent.interpreters.rst:247 |
369 | 377 | msgid "" |
370 | 378 | "Generally, :class:`Interpreter` shouldn't be called directly. Instead, use :" |
371 | 379 | "func:`create` or one of the other module functions." |
372 | 380 | msgstr "" |
373 | 381 |
|
374 | | -#: ../../library/concurrent.interpreters.rst:248 |
375 | | -#: ../../library/concurrent.interpreters.rst:254 |
376 | | -#: ../../library/concurrent.interpreters.rst:333 |
| 382 | +#: ../../library/concurrent.interpreters.rst:252 |
| 383 | +#: ../../library/concurrent.interpreters.rst:258 |
| 384 | +#: ../../library/concurrent.interpreters.rst:339 |
377 | 385 | msgid "(read-only)" |
378 | 386 | msgstr "" |
379 | 387 |
|
380 | | -#: ../../library/concurrent.interpreters.rst:250 |
| 388 | +#: ../../library/concurrent.interpreters.rst:254 |
381 | 389 | msgid "The underlying interpreter's ID." |
382 | 390 | msgstr "" |
383 | 391 |
|
384 | | -#: ../../library/concurrent.interpreters.rst:256 |
| 392 | +#: ../../library/concurrent.interpreters.rst:260 |
385 | 393 | msgid "A string describing where the interpreter came from." |
386 | 394 | msgstr "" |
387 | 395 |
|
388 | | -#: ../../library/concurrent.interpreters.rst:260 |
| 396 | +#: ../../library/concurrent.interpreters.rst:264 |
389 | 397 | msgid "" |
390 | 398 | "Return ``True`` if the interpreter is currently executing code in its :mod:`!" |
391 | 399 | "__main__` module and ``False`` otherwise." |
392 | 400 | msgstr "" |
393 | 401 |
|
394 | | -#: ../../library/concurrent.interpreters.rst:265 |
| 402 | +#: ../../library/concurrent.interpreters.rst:269 |
395 | 403 | msgid "Finalize and destroy the interpreter." |
396 | 404 | msgstr "" |
397 | 405 |
|
398 | | -#: ../../library/concurrent.interpreters.rst:269 |
| 406 | +#: ../../library/concurrent.interpreters.rst:273 |
399 | 407 | msgid "Bind objects in the interpreter's :mod:`!__main__` module." |
400 | 408 | msgstr "" |
401 | 409 |
|
402 | | -#: ../../library/concurrent.interpreters.rst:271 |
403 | | -#: ../../library/concurrent.interpreters.rst:328 |
| 410 | +#: ../../library/concurrent.interpreters.rst:275 |
| 411 | +#: ../../library/concurrent.interpreters.rst:334 |
404 | 412 | msgid "" |
405 | 413 | "Some objects are actually shared and some are copied efficiently, but most " |
406 | 414 | "are copied via :mod:`pickle`. See :ref:`interp-object-sharing`." |
407 | 415 | msgstr "" |
408 | 416 |
|
409 | | -#: ../../library/concurrent.interpreters.rst:276 |
| 417 | +#: ../../library/concurrent.interpreters.rst:280 |
410 | 418 | msgid "Run the given source code in the interpreter (in the current thread)." |
411 | 419 | msgstr "" |
412 | 420 |
|
413 | | -#: ../../library/concurrent.interpreters.rst:280 |
| 421 | +#: ../../library/concurrent.interpreters.rst:284 |
414 | 422 | msgid "" |
415 | 423 | "Return the result of running the given function in the interpreter (in the " |
416 | 424 | "current thread)." |
417 | 425 | msgstr "" |
418 | 426 |
|
419 | | -#: ../../library/concurrent.interpreters.rst:287 |
| 427 | +#: ../../library/concurrent.interpreters.rst:291 |
420 | 428 | msgid "Run the given function in the interpreter (in a new thread)." |
421 | 429 | msgstr "" |
422 | 430 |
|
423 | | -#: ../../library/concurrent.interpreters.rst:290 |
| 431 | +#: ../../library/concurrent.interpreters.rst:294 |
424 | 432 | msgid "Exceptions" |
425 | 433 | msgstr "例外" |
426 | 434 |
|
427 | | -#: ../../library/concurrent.interpreters.rst:294 |
| 435 | +#: ../../library/concurrent.interpreters.rst:298 |
428 | 436 | msgid "" |
429 | 437 | "This exception, a subclass of :exc:`Exception`, is raised when an " |
430 | 438 | "interpreter-related error happens." |
431 | 439 | msgstr "" |
432 | 440 |
|
433 | | -#: ../../library/concurrent.interpreters.rst:299 |
| 441 | +#: ../../library/concurrent.interpreters.rst:303 |
434 | 442 | msgid "" |
435 | 443 | "This exception, a subclass of :exc:`InterpreterError`, is raised when the " |
436 | 444 | "targeted interpreter no longer exists." |
437 | 445 | msgstr "" |
438 | 446 |
|
439 | | -#: ../../library/concurrent.interpreters.rst:304 |
| 447 | +#: ../../library/concurrent.interpreters.rst:308 |
440 | 448 | msgid "" |
441 | 449 | "This exception, a subclass of :exc:`InterpreterError`, is raised when the " |
442 | 450 | "running code raised an uncaught exception." |
443 | 451 | msgstr "" |
444 | 452 |
|
445 | | -#: ../../library/concurrent.interpreters.rst:309 |
| 453 | +#: ../../library/concurrent.interpreters.rst:313 |
446 | 454 | msgid "A basic snapshot of the exception raised in the other interpreter." |
447 | 455 | msgstr "" |
448 | 456 |
|
449 | | -#: ../../library/concurrent.interpreters.rst:315 |
| 457 | +#: ../../library/concurrent.interpreters.rst:319 |
450 | 458 | msgid "" |
451 | 459 | "This exception, a subclass of :exc:`TypeError`, is raised when an object " |
452 | 460 | "cannot be sent to another interpreter." |
453 | 461 | msgstr "" |
454 | 462 |
|
455 | | -#: ../../library/concurrent.interpreters.rst:320 |
| 463 | +#: ../../library/concurrent.interpreters.rst:324 |
456 | 464 | msgid "Communicating Between Interpreters" |
457 | 465 | msgstr "在直譯器之間溝通" |
458 | 466 |
|
459 | | -#: ../../library/concurrent.interpreters.rst:324 |
| 467 | +#: ../../library/concurrent.interpreters.rst:328 |
460 | 468 | msgid "" |
461 | | -"A wrapper around a low-level, cross-interpreter queue, which implements the :" |
462 | | -"class:`queue.Queue` interface. The underlying queue can only be created " |
463 | | -"through :func:`create_queue`." |
| 469 | +"A wrapper around a low-level, cross-interpreter queue, which implements all " |
| 470 | +"the methods of :class:`queue.Queue` except for :meth:`~queue.Queue." |
| 471 | +"task_done`, :meth:`~queue.Queue.join` and :meth:`~queue.Queue.shutdown`. " |
| 472 | +"The underlying queue can only be created through :func:`create_queue`." |
464 | 473 | msgstr "" |
465 | 474 |
|
466 | | -#: ../../library/concurrent.interpreters.rst:335 |
| 475 | +#: ../../library/concurrent.interpreters.rst:341 |
467 | 476 | msgid "The queue's ID." |
468 | 477 | msgstr "" |
469 | 478 |
|
470 | | -#: ../../library/concurrent.interpreters.rst:340 |
| 479 | +#: ../../library/concurrent.interpreters.rst:345 |
| 480 | +msgid "Return the number of items in the queue." |
| 481 | +msgstr "" |
| 482 | + |
| 483 | +#: ../../library/concurrent.interpreters.rst:349 |
| 484 | +msgid "Return ``True`` if the queue is empty, ``False`` otherwise." |
| 485 | +msgstr "" |
| 486 | + |
| 487 | +#: ../../library/concurrent.interpreters.rst:353 |
| 488 | +msgid "Return ``True`` if the queue is full, ``False`` otherwise." |
| 489 | +msgstr "" |
| 490 | + |
| 491 | +#: ../../library/concurrent.interpreters.rst:357 |
| 492 | +msgid "" |
| 493 | +"Put *obj* into the queue. If optional args *block* is true and *timeout* is " |
| 494 | +"``None`` (the default), block if necessary until a free slot is available. " |
| 495 | +"If *timeout* is a positive number, it blocks at most *timeout* seconds and " |
| 496 | +"raises the :exc:`QueueFull` exception if no free slot was available within " |
| 497 | +"that time. Otherwise (*block* is false), put an object on the queue if a " |
| 498 | +"free slot is immediately available, else raise the :exc:`QueueFull` " |
| 499 | +"exception (*timeout* is ignored in that case)." |
| 500 | +msgstr "" |
| 501 | + |
| 502 | +#: ../../library/concurrent.interpreters.rst:368 |
| 503 | +msgid "Equivalent to ``put(obj, block=False)``." |
| 504 | +msgstr "" |
| 505 | + |
| 506 | +#: ../../library/concurrent.interpreters.rst:372 |
471 | 507 | msgid "" |
472 | | -"This exception, a subclass of :exc:`queue.Empty`, is raised from :meth:`!" |
473 | | -"Queue.get` and :meth:`!Queue.get_nowait` when the queue is empty." |
| 508 | +"Remove and return an object from the queue. If optional args *block* is " |
| 509 | +"true and *timeout* is ``None`` (the default), block if necessary until an " |
| 510 | +"object is available. If *timeout* is a positive number, it blocks at most " |
| 511 | +"*timeout* seconds and raises the :exc:`QueueEmpty` exception if no object " |
| 512 | +"was available within that time. Otherwise (*block* is false), return an " |
| 513 | +"object if one is immediately available, else raise the :exc:`QueueEmpty` " |
| 514 | +"exception (*timeout* is ignored in that case)." |
474 | 515 | msgstr "" |
475 | 516 |
|
476 | | -#: ../../library/concurrent.interpreters.rst:346 |
| 517 | +#: ../../library/concurrent.interpreters.rst:383 |
| 518 | +msgid "Equivalent to ``get(block=False)``." |
| 519 | +msgstr "" |
| 520 | + |
| 521 | +#: ../../library/concurrent.interpreters.rst:388 |
| 522 | +msgid "" |
| 523 | +"This exception, a subclass of :exc:`queue.Empty`, is raised from :meth:" |
| 524 | +"`Queue.get` and :meth:`Queue.get_nowait` when the queue is empty." |
| 525 | +msgstr "" |
| 526 | + |
| 527 | +#: ../../library/concurrent.interpreters.rst:394 |
477 | 528 | msgid "" |
478 | | -"This exception, a subclass of :exc:`queue.Full`, is raised from :meth:`!" |
479 | | -"Queue.put` and :meth:`!Queue.put_nowait` when the queue is full." |
| 529 | +"This exception, a subclass of :exc:`queue.Full`, is raised from :meth:`Queue." |
| 530 | +"put` and :meth:`Queue.put_nowait` when the queue is full." |
480 | 531 | msgstr "" |
481 | 532 |
|
482 | | -#: ../../library/concurrent.interpreters.rst:352 |
| 533 | +#: ../../library/concurrent.interpreters.rst:400 |
483 | 534 | msgid "Basic usage" |
484 | 535 | msgstr "基本用法" |
485 | 536 |
|
486 | | -#: ../../library/concurrent.interpreters.rst:354 |
| 537 | +#: ../../library/concurrent.interpreters.rst:402 |
487 | 538 | msgid "Creating an interpreter and running code in it::" |
488 | 539 | msgstr "建立一個直譯器並在其中運行程式碼: ::" |
489 | 540 |
|
490 | | -#: ../../library/concurrent.interpreters.rst:356 |
| 541 | +#: ../../library/concurrent.interpreters.rst:404 |
491 | 542 | msgid "" |
492 | 543 | "from concurrent import interpreters\n" |
493 | 544 | "\n" |
@@ -522,3 +573,23 @@ msgid "" |
522 | 573 | "t = interp.call_in_thread(run)\n" |
523 | 574 | "t.join()" |
524 | 575 | msgstr "" |
| 576 | + |
| 577 | +#: ../../library/concurrent.interpreters.rst:437 |
| 578 | +#, fuzzy |
| 579 | +msgid "Communicating between interpreters with a queue::" |
| 580 | +msgstr "在直譯器之間溝通" |
| 581 | + |
| 582 | +#: ../../library/concurrent.interpreters.rst:439 |
| 583 | +msgid "" |
| 584 | +"from concurrent import interpreters\n" |
| 585 | +"\n" |
| 586 | +"interp = interpreters.create()\n" |
| 587 | +"queue = interpreters.create_queue()\n" |
| 588 | +"\n" |
| 589 | +"def worker(queue):\n" |
| 590 | +" queue.put('spam!')\n" |
| 591 | +"\n" |
| 592 | +"t = interp.call_in_thread(worker, queue)\n" |
| 593 | +"print(queue.get())\n" |
| 594 | +"t.join()" |
| 595 | +msgstr "" |
0 commit comments