Skip to content

Commit 10e22e3

Browse files
sync with cpython 69092874
1 parent 679ceca commit 10e22e3

3 files changed

Lines changed: 786 additions & 703 deletions

File tree

‎library/concurrent.interpreters.po‎

Lines changed: 109 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.14\n"
99
"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"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -357,137 +357,188 @@ msgid ""
357357
"for it."
358358
msgstr ""
359359

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."
362366
msgstr ""
363367

364368
#: ../../library/concurrent.interpreters.rst:241
369+
msgid "Interpreter objects"
370+
msgstr ""
371+
372+
#: ../../library/concurrent.interpreters.rst:245
365373
msgid "A single interpreter in the current process."
366374
msgstr ""
367375

368-
#: ../../library/concurrent.interpreters.rst:243
376+
#: ../../library/concurrent.interpreters.rst:247
369377
msgid ""
370378
"Generally, :class:`Interpreter` shouldn't be called directly. Instead, use :"
371379
"func:`create` or one of the other module functions."
372380
msgstr ""
373381

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
377385
msgid "(read-only)"
378386
msgstr ""
379387

380-
#: ../../library/concurrent.interpreters.rst:250
388+
#: ../../library/concurrent.interpreters.rst:254
381389
msgid "The underlying interpreter's ID."
382390
msgstr ""
383391

384-
#: ../../library/concurrent.interpreters.rst:256
392+
#: ../../library/concurrent.interpreters.rst:260
385393
msgid "A string describing where the interpreter came from."
386394
msgstr ""
387395

388-
#: ../../library/concurrent.interpreters.rst:260
396+
#: ../../library/concurrent.interpreters.rst:264
389397
msgid ""
390398
"Return ``True`` if the interpreter is currently executing code in its :mod:`!"
391399
"__main__` module and ``False`` otherwise."
392400
msgstr ""
393401

394-
#: ../../library/concurrent.interpreters.rst:265
402+
#: ../../library/concurrent.interpreters.rst:269
395403
msgid "Finalize and destroy the interpreter."
396404
msgstr ""
397405

398-
#: ../../library/concurrent.interpreters.rst:269
406+
#: ../../library/concurrent.interpreters.rst:273
399407
msgid "Bind objects in the interpreter's :mod:`!__main__` module."
400408
msgstr ""
401409

402-
#: ../../library/concurrent.interpreters.rst:271
403-
#: ../../library/concurrent.interpreters.rst:328
410+
#: ../../library/concurrent.interpreters.rst:275
411+
#: ../../library/concurrent.interpreters.rst:334
404412
msgid ""
405413
"Some objects are actually shared and some are copied efficiently, but most "
406414
"are copied via :mod:`pickle`. See :ref:`interp-object-sharing`."
407415
msgstr ""
408416

409-
#: ../../library/concurrent.interpreters.rst:276
417+
#: ../../library/concurrent.interpreters.rst:280
410418
msgid "Run the given source code in the interpreter (in the current thread)."
411419
msgstr ""
412420

413-
#: ../../library/concurrent.interpreters.rst:280
421+
#: ../../library/concurrent.interpreters.rst:284
414422
msgid ""
415423
"Return the result of running the given function in the interpreter (in the "
416424
"current thread)."
417425
msgstr ""
418426

419-
#: ../../library/concurrent.interpreters.rst:287
427+
#: ../../library/concurrent.interpreters.rst:291
420428
msgid "Run the given function in the interpreter (in a new thread)."
421429
msgstr ""
422430

423-
#: ../../library/concurrent.interpreters.rst:290
431+
#: ../../library/concurrent.interpreters.rst:294
424432
msgid "Exceptions"
425433
msgstr "例外"
426434

427-
#: ../../library/concurrent.interpreters.rst:294
435+
#: ../../library/concurrent.interpreters.rst:298
428436
msgid ""
429437
"This exception, a subclass of :exc:`Exception`, is raised when an "
430438
"interpreter-related error happens."
431439
msgstr ""
432440

433-
#: ../../library/concurrent.interpreters.rst:299
441+
#: ../../library/concurrent.interpreters.rst:303
434442
msgid ""
435443
"This exception, a subclass of :exc:`InterpreterError`, is raised when the "
436444
"targeted interpreter no longer exists."
437445
msgstr ""
438446

439-
#: ../../library/concurrent.interpreters.rst:304
447+
#: ../../library/concurrent.interpreters.rst:308
440448
msgid ""
441449
"This exception, a subclass of :exc:`InterpreterError`, is raised when the "
442450
"running code raised an uncaught exception."
443451
msgstr ""
444452

445-
#: ../../library/concurrent.interpreters.rst:309
453+
#: ../../library/concurrent.interpreters.rst:313
446454
msgid "A basic snapshot of the exception raised in the other interpreter."
447455
msgstr ""
448456

449-
#: ../../library/concurrent.interpreters.rst:315
457+
#: ../../library/concurrent.interpreters.rst:319
450458
msgid ""
451459
"This exception, a subclass of :exc:`TypeError`, is raised when an object "
452460
"cannot be sent to another interpreter."
453461
msgstr ""
454462

455-
#: ../../library/concurrent.interpreters.rst:320
463+
#: ../../library/concurrent.interpreters.rst:324
456464
msgid "Communicating Between Interpreters"
457465
msgstr "在直譯器之間溝通"
458466

459-
#: ../../library/concurrent.interpreters.rst:324
467+
#: ../../library/concurrent.interpreters.rst:328
460468
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`."
464473
msgstr ""
465474

466-
#: ../../library/concurrent.interpreters.rst:335
475+
#: ../../library/concurrent.interpreters.rst:341
467476
msgid "The queue's ID."
468477
msgstr ""
469478

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
471507
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)."
474515
msgstr ""
475516

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
477528
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."
480531
msgstr ""
481532

482-
#: ../../library/concurrent.interpreters.rst:352
533+
#: ../../library/concurrent.interpreters.rst:400
483534
msgid "Basic usage"
484535
msgstr "基本用法"
485536

486-
#: ../../library/concurrent.interpreters.rst:354
537+
#: ../../library/concurrent.interpreters.rst:402
487538
msgid "Creating an interpreter and running code in it::"
488539
msgstr "建立一個直譯器並在其中運行程式碼: ::"
489540

490-
#: ../../library/concurrent.interpreters.rst:356
541+
#: ../../library/concurrent.interpreters.rst:404
491542
msgid ""
492543
"from concurrent import interpreters\n"
493544
"\n"
@@ -522,3 +573,23 @@ msgid ""
522573
"t = interp.call_in_thread(run)\n"
523574
"t.join()"
524575
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

Comments
 (0)