Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b9be9ba

Browse files
authoredMay 23, 2024·
sync with cpython 0d5fe2c7
1 parent ccec659 commit b9be9ba

File tree

3 files changed

+180
-136
lines changed

3 files changed

+180
-136
lines changed
 

‎library/hashlib.po

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-05-09 00:03+0000\n"
10+
"POT-Creation-Date: 2024-05-23 00:03+0000\n"
1111
"PO-Revision-Date: 2018-05-23 16:03+0000\n"
1212
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -351,8 +351,9 @@ msgstr ""
351351

352352
#: ../../library/hashlib.rst:331
353353
msgid ""
354-
"*dklen* is the length of the derived key. If *dklen* is ``None`` then the "
355-
"digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512."
354+
"*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` "
355+
"then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for "
356+
"SHA-512."
356357
msgstr ""
357358

358359
#: ../../library/hashlib.rst:340
@@ -383,7 +384,7 @@ msgstr ""
383384
msgid ""
384385
"*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization "
385386
"factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). "
386-
"*dklen* is the length of the derived key."
387+
"*dklen* is the length of the derived key in bytes."
387388
msgstr ""
388389

389390
#: ../../library/hashlib.rst:366

‎library/threading.po

Lines changed: 173 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-05-09 00:03+0000\n"
10+
"POT-Creation-Date: 2024-05-23 00:03+0000\n"
1111
"PO-Revision-Date: 2018-05-23 16:12+0000\n"
1212
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -696,7 +696,7 @@ msgid ""
696696
"by the platform."
697697
msgstr ""
698698

699-
#: ../../library/threading.rst:541 ../../library/threading.rst:621
699+
#: ../../library/threading.rst:541 ../../library/threading.rst:632
700700
msgid "Acquire a lock, blocking or non-blocking."
701701
msgstr ""
702702

@@ -728,8 +728,8 @@ msgid ""
728728
"if not (for example if the *timeout* expired)."
729729
msgstr ""
730730

731-
#: ../../library/threading.rst:559 ../../library/threading.rst:643
732-
#: ../../library/threading.rst:890
731+
#: ../../library/threading.rst:559 ../../library/threading.rst:670
732+
#: ../../library/threading.rst:917
733733
msgid "The *timeout* parameter is new."
734734
msgstr ""
735735

@@ -756,7 +756,7 @@ msgstr ""
756756
msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised."
757757
msgstr ""
758758

759-
#: ../../library/threading.rst:578 ../../library/threading.rst:659
759+
#: ../../library/threading.rst:578 ../../library/threading.rst:686
760760
msgid "There is no return value."
761761
msgstr ""
762762

@@ -779,70 +779,112 @@ msgstr ""
779779

780780
#: ../../library/threading.rst:597
781781
msgid ""
782-
"To lock the lock, a thread calls its :meth:`~RLock.acquire` method; this "
783-
"returns once the thread owns the lock. To unlock the lock, a thread calls "
784-
"its :meth:`~Lock.release` method. :meth:`~Lock.acquire`/:meth:`~Lock."
785-
"release` call pairs may be nested; only the final :meth:`~Lock.release` "
786-
"(the :meth:`~Lock.release` of the outermost pair) resets the lock to "
787-
"unlocked and allows another thread blocked in :meth:`~Lock.acquire` to "
788-
"proceed."
782+
"Threads call a lock's :meth:`~RLock.acquire` method to lock it, and its :"
783+
"meth:`~Lock.release` method to unlock it."
789784
msgstr ""
790785

791-
#: ../../library/threading.rst:604
786+
#: ../../library/threading.rst:602
792787
msgid ""
793-
"Reentrant locks also support the :ref:`context management protocol <with-"
794-
"locks>`."
788+
"Reentrant locks support the :ref:`context management protocol <with-locks>`, "
789+
"so it is recommended to use :keyword:`with` instead of manually calling :"
790+
"meth:`~RLock.acquire` and :meth:`~RLock.release` to handle acquiring and "
791+
"releasing the lock for a block of code."
795792
msgstr ""
796793

797-
#: ../../library/threading.rst:609
794+
#: ../../library/threading.rst:607
795+
msgid ""
796+
"RLock's :meth:`~RLock.acquire`/:meth:`~RLock.release` call pairs may be "
797+
"nested, unlike Lock's :meth:`~Lock.acquire`/:meth:`~Lock.release`. Only the "
798+
"final :meth:`~RLock.release` (the :meth:`~Lock.release` of the outermost "
799+
"pair) resets the lock to an unlocked state and allows another thread blocked "
800+
"in :meth:`~RLock.acquire` to proceed."
801+
msgstr ""
802+
803+
#: ../../library/threading.rst:613
804+
msgid ""
805+
":meth:`~RLock.acquire`/:meth:`~RLock.release` must be used in pairs: each "
806+
"acquire must have a release in the thread that has acquired the lock. "
807+
"Failing to call release as many times the lock has been acquired can lead to "
808+
"deadlock."
809+
msgstr ""
810+
811+
#: ../../library/threading.rst:620
798812
msgid ""
799813
"This class implements reentrant lock objects. A reentrant lock must be "
800814
"released by the thread that acquired it. Once a thread has acquired a "
801815
"reentrant lock, the same thread may acquire it again without blocking; the "
802816
"thread must release it once for each time it has acquired it."
803817
msgstr ""
804818

805-
#: ../../library/threading.rst:614
819+
#: ../../library/threading.rst:625
806820
msgid ""
807821
"Note that ``RLock`` is actually a factory function which returns an instance "
808822
"of the most efficient version of the concrete RLock class that is supported "
809823
"by the platform."
810824
msgstr ""
811825

812-
#: ../../library/threading.rst:623
826+
#: ../../library/threading.rst:636
827+
msgid ":ref:`Using RLock as a context manager <with-locks>`"
828+
msgstr ""
829+
830+
#: ../../library/threading.rst:637
813831
msgid ""
814-
"When invoked without arguments: if this thread already owns the lock, "
815-
"increment the recursion level by one, and return immediately. Otherwise, if "
816-
"another thread owns the lock, block until the lock is unlocked. Once the "
817-
"lock is unlocked (not owned by any thread), then grab ownership, set the "
818-
"recursion level to one, and return. If more than one thread is blocked "
819-
"waiting until the lock is unlocked, only one at a time will be able to grab "
820-
"ownership of the lock. There is no return value in this case."
832+
"Recommended over manual :meth:`!acquire` and :meth:`release` calls whenever "
833+
"practical."
821834
msgstr ""
822835

823-
#: ../../library/threading.rst:631
836+
#: ../../library/threading.rst:641
824837
msgid ""
825-
"When invoked with the *blocking* argument set to ``True``, do the same thing "
826-
"as when called without arguments, and return ``True``."
838+
"When invoked with the *blocking* argument set to ``True`` (the default):"
839+
msgstr ""
840+
841+
#: ../../library/threading.rst:643 ../../library/threading.rst:655
842+
msgid "If no thread owns the lock, acquire the lock and return immediately."
827843
msgstr ""
828844

829-
#: ../../library/threading.rst:634
845+
#: ../../library/threading.rst:645
830846
msgid ""
831-
"When invoked with the *blocking* argument set to ``False``, do not block. "
832-
"If a call without an argument would block, return ``False`` immediately; "
833-
"otherwise, do the same thing as when called without arguments, and return "
834-
"``True``."
847+
"If another thread owns the lock, block until we are able to acquire lock, or "
848+
"*timeout*, if set to a positive float value."
835849
msgstr ""
836850

837-
#: ../../library/threading.rst:638
851+
#: ../../library/threading.rst:648
838852
msgid ""
839-
"When invoked with the floating-point *timeout* argument set to a positive "
840-
"value, block for at most the number of seconds specified by *timeout* and as "
841-
"long as the lock cannot be acquired. Return ``True`` if the lock has been "
842-
"acquired, ``False`` if the timeout has elapsed."
853+
"If the same thread owns the lock, acquire the lock again, and return "
854+
"immediately. This is the difference between :class:`Lock` and :class:`!"
855+
"RLock`; :class:`Lock` handles this case the same as the previous, blocking "
856+
"until the lock can be acquired."
843857
msgstr ""
844858

845-
#: ../../library/threading.rst:649
859+
#: ../../library/threading.rst:653
860+
msgid "When invoked with the *blocking* argument set to ``False``:"
861+
msgstr ""
862+
863+
#: ../../library/threading.rst:657
864+
msgid "If another thread owns the lock, return immediately."
865+
msgstr ""
866+
867+
#: ../../library/threading.rst:659
868+
msgid ""
869+
"If the same thread owns the lock, acquire the lock again and return "
870+
"immediately."
871+
msgstr ""
872+
873+
#: ../../library/threading.rst:662
874+
msgid ""
875+
"In all cases, if the thread was able to acquire the lock, return ``True``. "
876+
"If the thread was unable to acquire the lock (i.e. if not blocking or the "
877+
"timeout was reached) return ``False``."
878+
msgstr ""
879+
880+
#: ../../library/threading.rst:666
881+
msgid ""
882+
"If called multiple times, failing to call :meth:`~RLock.release` as many "
883+
"times may lead to deadlock. Consider using :class:`!RLock` as a context "
884+
"manager rather than calling acquire/release directly."
885+
msgstr ""
886+
887+
#: ../../library/threading.rst:676
846888
msgid ""
847889
"Release a lock, decrementing the recursion level. If after the decrement it "
848890
"is zero, reset the lock to unlocked (not owned by any thread), and if any "
@@ -851,25 +893,26 @@ msgid ""
851893
"is still nonzero, the lock remains locked and owned by the calling thread."
852894
msgstr ""
853895

854-
#: ../../library/threading.rst:655
896+
#: ../../library/threading.rst:682
855897
msgid ""
856898
"Only call this method when the calling thread owns the lock. A :exc:"
857-
"`RuntimeError` is raised if this method is called when the lock is unlocked."
899+
"`RuntimeError` is raised if this method is called when the lock is not "
900+
"acquired."
858901
msgstr ""
859902

860-
#: ../../library/threading.rst:665
903+
#: ../../library/threading.rst:692
861904
msgid "Condition Objects"
862905
msgstr ""
863906

864-
#: ../../library/threading.rst:667
907+
#: ../../library/threading.rst:694
865908
msgid ""
866909
"A condition variable is always associated with some kind of lock; this can "
867910
"be passed in or one will be created by default. Passing one in is useful "
868911
"when several condition variables must share the same lock. The lock is part "
869912
"of the condition object: you don't have to track it separately."
870913
msgstr ""
871914

872-
#: ../../library/threading.rst:672
915+
#: ../../library/threading.rst:699
873916
msgid ""
874917
"A condition variable obeys the :ref:`context management protocol <with-"
875918
"locks>`: using the ``with`` statement acquires the associated lock for the "
@@ -878,7 +921,7 @@ msgid ""
878921
"associated lock."
879922
msgstr ""
880923

881-
#: ../../library/threading.rst:678
924+
#: ../../library/threading.rst:705
882925
msgid ""
883926
"Other methods must be called with the associated lock held. The :meth:"
884927
"`~Condition.wait` method releases the lock, and then blocks until another "
@@ -887,14 +930,14 @@ msgid ""
887930
"and returns. It is also possible to specify a timeout."
888931
msgstr ""
889932

890-
#: ../../library/threading.rst:684
933+
#: ../../library/threading.rst:711
891934
msgid ""
892935
"The :meth:`~Condition.notify` method wakes up one of the threads waiting for "
893936
"the condition variable, if any are waiting. The :meth:`~Condition."
894937
"notify_all` method wakes up all threads waiting for the condition variable."
895938
msgstr ""
896939

897-
#: ../../library/threading.rst:688
940+
#: ../../library/threading.rst:715
898941
msgid ""
899942
"Note: the :meth:`~Condition.notify` and :meth:`~Condition.notify_all` "
900943
"methods don't release the lock; this means that the thread or threads "
@@ -903,7 +946,7 @@ msgid ""
903946
"or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock."
904947
msgstr ""
905948

906-
#: ../../library/threading.rst:694
949+
#: ../../library/threading.rst:721
907950
msgid ""
908951
"The typical programming style using condition variables uses the lock to "
909952
"synchronize access to some shared state; threads that are interested in a "
@@ -915,7 +958,7 @@ msgid ""
915958
"situation with unlimited buffer capacity::"
916959
msgstr ""
917960

918-
#: ../../library/threading.rst:714
961+
#: ../../library/threading.rst:741
919962
msgid ""
920963
"The ``while`` loop checking for the application's condition is necessary "
921964
"because :meth:`~Condition.wait` can return after an arbitrary long time, and "
@@ -925,7 +968,7 @@ msgid ""
925968
"checking, and eases the computation of timeouts::"
926969
msgstr ""
927970

928-
#: ../../library/threading.rst:726
971+
#: ../../library/threading.rst:753
929972
msgid ""
930973
"To choose between :meth:`~Condition.notify` and :meth:`~Condition."
931974
"notify_all`, consider whether one state change can be interesting for only "
@@ -934,60 +977,60 @@ msgid ""
934977
"thread."
935978
msgstr ""
936979

937-
#: ../../library/threading.rst:734
980+
#: ../../library/threading.rst:761
938981
msgid ""
939982
"This class implements condition variable objects. A condition variable "
940983
"allows one or more threads to wait until they are notified by another thread."
941984
msgstr ""
942985

943-
#: ../../library/threading.rst:737
986+
#: ../../library/threading.rst:764
944987
msgid ""
945988
"If the *lock* argument is given and not ``None``, it must be a :class:`Lock` "
946989
"or :class:`RLock` object, and it is used as the underlying lock. Otherwise, "
947990
"a new :class:`RLock` object is created and used as the underlying lock."
948991
msgstr ""
949992

950-
#: ../../library/threading.rst:741 ../../library/threading.rst:865
951-
#: ../../library/threading.rst:911 ../../library/threading.rst:963
952-
#: ../../library/threading.rst:1031
993+
#: ../../library/threading.rst:768 ../../library/threading.rst:892
994+
#: ../../library/threading.rst:938 ../../library/threading.rst:990
995+
#: ../../library/threading.rst:1058
953996
msgid "changed from a factory function to a class."
954997
msgstr ""
955998

956-
#: ../../library/threading.rst:746
999+
#: ../../library/threading.rst:773
9571000
msgid ""
9581001
"Acquire the underlying lock. This method calls the corresponding method on "
9591002
"the underlying lock; the return value is whatever that method returns."
9601003
msgstr ""
9611004

962-
#: ../../library/threading.rst:751
1005+
#: ../../library/threading.rst:778
9631006
msgid ""
9641007
"Release the underlying lock. This method calls the corresponding method on "
9651008
"the underlying lock; there is no return value."
9661009
msgstr ""
9671010

968-
#: ../../library/threading.rst:756
1011+
#: ../../library/threading.rst:783
9691012
msgid ""
9701013
"Wait until notified or until a timeout occurs. If the calling thread has not "
9711014
"acquired the lock when this method is called, a :exc:`RuntimeError` is "
9721015
"raised."
9731016
msgstr ""
9741017

975-
#: ../../library/threading.rst:760
1018+
#: ../../library/threading.rst:787
9761019
msgid ""
9771020
"This method releases the underlying lock, and then blocks until it is "
9781021
"awakened by a :meth:`notify` or :meth:`notify_all` call for the same "
9791022
"condition variable in another thread, or until the optional timeout occurs. "
9801023
"Once awakened or timed out, it re-acquires the lock and returns."
9811024
msgstr ""
9821025

983-
#: ../../library/threading.rst:765
1026+
#: ../../library/threading.rst:792
9841027
msgid ""
9851028
"When the *timeout* argument is present and not ``None``, it should be a "
9861029
"floating point number specifying a timeout for the operation in seconds (or "
9871030
"fractions thereof)."
9881031
msgstr ""
9891032

990-
#: ../../library/threading.rst:769
1033+
#: ../../library/threading.rst:796
9911034
msgid ""
9921035
"When the underlying lock is an :class:`RLock`, it is not released using its :"
9931036
"meth:`release` method, since this may not actually unlock the lock when it "
@@ -997,97 +1040,97 @@ msgid ""
9971040
"used to restore the recursion level when the lock is reacquired."
9981041
msgstr ""
9991042

1000-
#: ../../library/threading.rst:777
1043+
#: ../../library/threading.rst:804
10011044
msgid ""
10021045
"The return value is ``True`` unless a given *timeout* expired, in which case "
10031046
"it is ``False``."
10041047
msgstr ""
10051048

1006-
#: ../../library/threading.rst:780 ../../library/threading.rst:996
1049+
#: ../../library/threading.rst:807 ../../library/threading.rst:1023
10071050
msgid "Previously, the method always returned ``None``."
10081051
msgstr ""
10091052

1010-
#: ../../library/threading.rst:785
1053+
#: ../../library/threading.rst:812
10111054
msgid ""
10121055
"Wait until a condition evaluates to true. *predicate* should be a callable "
10131056
"which result will be interpreted as a boolean value. A *timeout* may be "
10141057
"provided giving the maximum time to wait."
10151058
msgstr ""
10161059

1017-
#: ../../library/threading.rst:789
1060+
#: ../../library/threading.rst:816
10181061
msgid ""
10191062
"This utility method may call :meth:`wait` repeatedly until the predicate is "
10201063
"satisfied, or until a timeout occurs. The return value is the last return "
10211064
"value of the predicate and will evaluate to ``False`` if the method timed "
10221065
"out."
10231066
msgstr ""
10241067

1025-
#: ../../library/threading.rst:794
1068+
#: ../../library/threading.rst:821
10261069
msgid ""
10271070
"Ignoring the timeout feature, calling this method is roughly equivalent to "
10281071
"writing::"
10291072
msgstr ""
10301073

1031-
#: ../../library/threading.rst:800
1074+
#: ../../library/threading.rst:827
10321075
msgid ""
10331076
"Therefore, the same rules apply as with :meth:`wait`: The lock must be held "
10341077
"when called and is re-acquired on return. The predicate is evaluated with "
10351078
"the lock held."
10361079
msgstr ""
10371080

1038-
#: ../../library/threading.rst:808
1081+
#: ../../library/threading.rst:835
10391082
msgid ""
10401083
"By default, wake up one thread waiting on this condition, if any. If the "
10411084
"calling thread has not acquired the lock when this method is called, a :exc:"
10421085
"`RuntimeError` is raised."
10431086
msgstr ""
10441087

1045-
#: ../../library/threading.rst:812
1088+
#: ../../library/threading.rst:839
10461089
msgid ""
10471090
"This method wakes up at most *n* of the threads waiting for the condition "
10481091
"variable; it is a no-op if no threads are waiting."
10491092
msgstr ""
10501093

1051-
#: ../../library/threading.rst:815
1094+
#: ../../library/threading.rst:842
10521095
msgid ""
10531096
"The current implementation wakes up exactly *n* threads, if at least *n* "
10541097
"threads are waiting. However, it's not safe to rely on this behavior. A "
10551098
"future, optimized implementation may occasionally wake up more than *n* "
10561099
"threads."
10571100
msgstr ""
10581101

1059-
#: ../../library/threading.rst:820
1102+
#: ../../library/threading.rst:847
10601103
msgid ""
10611104
"Note: an awakened thread does not actually return from its :meth:`wait` call "
10621105
"until it can reacquire the lock. Since :meth:`notify` does not release the "
10631106
"lock, its caller should."
10641107
msgstr ""
10651108

1066-
#: ../../library/threading.rst:826
1109+
#: ../../library/threading.rst:853
10671110
msgid ""
10681111
"Wake up all threads waiting on this condition. This method acts like :meth:"
10691112
"`notify`, but wakes up all waiting threads instead of one. If the calling "
10701113
"thread has not acquired the lock when this method is called, a :exc:"
10711114
"`RuntimeError` is raised."
10721115
msgstr ""
10731116

1074-
#: ../../library/threading.rst:831
1117+
#: ../../library/threading.rst:858
10751118
msgid "The method ``notifyAll`` is a deprecated alias for this method."
10761119
msgstr ""
10771120

1078-
#: ../../library/threading.rst:837
1121+
#: ../../library/threading.rst:864
10791122
msgid "Semaphore Objects"
10801123
msgstr ""
10811124

1082-
#: ../../library/threading.rst:839
1125+
#: ../../library/threading.rst:866
10831126
msgid ""
10841127
"This is one of the oldest synchronization primitives in the history of "
10851128
"computer science, invented by the early Dutch computer scientist Edsger W. "
10861129
"Dijkstra (he used the names ``P()`` and ``V()`` instead of :meth:`~Semaphore."
10871130
"acquire` and :meth:`~Semaphore.release`)."
10881131
msgstr ""
10891132

1090-
#: ../../library/threading.rst:844
1133+
#: ../../library/threading.rst:871
10911134
msgid ""
10921135
"A semaphore manages an internal counter which is decremented by each :meth:"
10931136
"`~Semaphore.acquire` call and incremented by each :meth:`~Semaphore.release` "
@@ -1096,12 +1139,12 @@ msgid ""
10961139
"meth:`~Semaphore.release`."
10971140
msgstr ""
10981141

1099-
#: ../../library/threading.rst:850
1142+
#: ../../library/threading.rst:877
11001143
msgid ""
11011144
"Semaphores also support the :ref:`context management protocol <with-locks>`."
11021145
msgstr ""
11031146

1104-
#: ../../library/threading.rst:855
1147+
#: ../../library/threading.rst:882
11051148
msgid ""
11061149
"This class implements semaphore objects. A semaphore manages an atomic "
11071150
"counter representing the number of :meth:`release` calls minus the number "
@@ -1110,28 +1153,28 @@ msgid ""
11101153
"If not given, *value* defaults to 1."
11111154
msgstr ""
11121155

1113-
#: ../../library/threading.rst:861
1156+
#: ../../library/threading.rst:888
11141157
msgid ""
11151158
"The optional argument gives the initial *value* for the internal counter; it "
11161159
"defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is "
11171160
"raised."
11181161
msgstr ""
11191162

1120-
#: ../../library/threading.rst:870
1163+
#: ../../library/threading.rst:897
11211164
msgid "Acquire a semaphore."
11221165
msgstr ""
11231166

1124-
#: ../../library/threading.rst:872
1167+
#: ../../library/threading.rst:899
11251168
msgid "When invoked without arguments:"
11261169
msgstr ""
11271170

1128-
#: ../../library/threading.rst:874
1171+
#: ../../library/threading.rst:901
11291172
msgid ""
11301173
"If the internal counter is larger than zero on entry, decrement it by one "
11311174
"and return ``True`` immediately."
11321175
msgstr ""
11331176

1134-
#: ../../library/threading.rst:876
1177+
#: ../../library/threading.rst:903
11351178
msgid ""
11361179
"If the internal counter is zero on entry, block until awoken by a call to :"
11371180
"meth:`~Semaphore.release`. Once awoken (and the counter is greater than 0), "
@@ -1140,32 +1183,32 @@ msgid ""
11401183
"threads are awoken should not be relied on."
11411184
msgstr ""
11421185

1143-
#: ../../library/threading.rst:882
1186+
#: ../../library/threading.rst:909
11441187
msgid ""
11451188
"When invoked with *blocking* set to ``False``, do not block. If a call "
11461189
"without an argument would block, return ``False`` immediately; otherwise, do "
11471190
"the same thing as when called without arguments, and return ``True``."
11481191
msgstr ""
11491192

1150-
#: ../../library/threading.rst:886
1193+
#: ../../library/threading.rst:913
11511194
msgid ""
11521195
"When invoked with a *timeout* other than ``None``, it will block for at most "
11531196
"*timeout* seconds. If acquire does not complete successfully in that "
11541197
"interval, return ``False``. Return ``True`` otherwise."
11551198
msgstr ""
11561199

1157-
#: ../../library/threading.rst:895
1200+
#: ../../library/threading.rst:922
11581201
msgid ""
11591202
"Release a semaphore, incrementing the internal counter by *n*. When it was "
11601203
"zero on entry and other threads are waiting for it to become larger than "
11611204
"zero again, wake up *n* of those threads."
11621205
msgstr ""
11631206

1164-
#: ../../library/threading.rst:899
1207+
#: ../../library/threading.rst:926
11651208
msgid "Added the *n* parameter to release multiple waiting threads at once."
11661209
msgstr ""
11671210

1168-
#: ../../library/threading.rst:905
1211+
#: ../../library/threading.rst:932
11691212
msgid ""
11701213
"Class implementing bounded semaphore objects. A bounded semaphore checks to "
11711214
"make sure its current value doesn't exceed its initial value. If it does, :"
@@ -1174,79 +1217,79 @@ msgid ""
11741217
"times it's a sign of a bug. If not given, *value* defaults to 1."
11751218
msgstr ""
11761219

1177-
#: ../../library/threading.rst:918
1220+
#: ../../library/threading.rst:945
11781221
msgid ":class:`Semaphore` Example"
11791222
msgstr ":class:`Semaphore` 範例"
11801223

1181-
#: ../../library/threading.rst:920
1224+
#: ../../library/threading.rst:947
11821225
msgid ""
11831226
"Semaphores are often used to guard resources with limited capacity, for "
11841227
"example, a database server. In any situation where the size of the resource "
11851228
"is fixed, you should use a bounded semaphore. Before spawning any worker "
11861229
"threads, your main thread would initialize the semaphore::"
11871230
msgstr ""
11881231

1189-
#: ../../library/threading.rst:929
1232+
#: ../../library/threading.rst:956
11901233
msgid ""
11911234
"Once spawned, worker threads call the semaphore's acquire and release "
11921235
"methods when they need to connect to the server::"
11931236
msgstr ""
11941237

1195-
#: ../../library/threading.rst:939
1238+
#: ../../library/threading.rst:966
11961239
msgid ""
11971240
"The use of a bounded semaphore reduces the chance that a programming error "
11981241
"which causes the semaphore to be released more than it's acquired will go "
11991242
"undetected."
12001243
msgstr ""
12011244

1202-
#: ../../library/threading.rst:946
1245+
#: ../../library/threading.rst:973
12031246
msgid "Event Objects"
12041247
msgstr ""
12051248

1206-
#: ../../library/threading.rst:948
1249+
#: ../../library/threading.rst:975
12071250
msgid ""
12081251
"This is one of the simplest mechanisms for communication between threads: "
12091252
"one thread signals an event and other threads wait for it."
12101253
msgstr ""
12111254

1212-
#: ../../library/threading.rst:951
1255+
#: ../../library/threading.rst:978
12131256
msgid ""
12141257
"An event object manages an internal flag that can be set to true with the :"
12151258
"meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` "
12161259
"method. The :meth:`~Event.wait` method blocks until the flag is true."
12171260
msgstr ""
12181261

1219-
#: ../../library/threading.rst:958
1262+
#: ../../library/threading.rst:985
12201263
msgid ""
12211264
"Class implementing event objects. An event manages a flag that can be set "
12221265
"to true with the :meth:`~Event.set` method and reset to false with the :meth:"
12231266
"`clear` method. The :meth:`wait` method blocks until the flag is true. The "
12241267
"flag is initially false."
12251268
msgstr ""
12261269

1227-
#: ../../library/threading.rst:968
1270+
#: ../../library/threading.rst:995
12281271
msgid "Return ``True`` if and only if the internal flag is true."
12291272
msgstr ""
12301273

1231-
#: ../../library/threading.rst:970
1274+
#: ../../library/threading.rst:997
12321275
msgid "The method ``isSet`` is a deprecated alias for this method."
12331276
msgstr ""
12341277

1235-
#: ../../library/threading.rst:974
1278+
#: ../../library/threading.rst:1001
12361279
msgid ""
12371280
"Set the internal flag to true. All threads waiting for it to become true are "
12381281
"awakened. Threads that call :meth:`wait` once the flag is true will not "
12391282
"block at all."
12401283
msgstr ""
12411284

1242-
#: ../../library/threading.rst:980
1285+
#: ../../library/threading.rst:1007
12431286
msgid ""
12441287
"Reset the internal flag to false. Subsequently, threads calling :meth:`wait` "
12451288
"will block until :meth:`.set` is called to set the internal flag to true "
12461289
"again."
12471290
msgstr ""
12481291

1249-
#: ../../library/threading.rst:986
1292+
#: ../../library/threading.rst:1013
12501293
msgid ""
12511294
"Block as long as the internal flag is false and the timeout, if given, has "
12521295
"not expired. The return value represents the reason that this blocking "
@@ -1255,26 +1298,26 @@ msgid ""
12551298
"become true within the given wait time."
12561299
msgstr ""
12571300

1258-
#: ../../library/threading.rst:992
1301+
#: ../../library/threading.rst:1019
12591302
msgid ""
12601303
"When the timeout argument is present and not ``None``, it should be a "
12611304
"floating point number specifying a timeout for the operation in seconds, or "
12621305
"fractions thereof."
12631306
msgstr ""
12641307

1265-
#: ../../library/threading.rst:1003
1308+
#: ../../library/threading.rst:1030
12661309
msgid "Timer Objects"
12671310
msgstr ""
12681311

1269-
#: ../../library/threading.rst:1005
1312+
#: ../../library/threading.rst:1032
12701313
msgid ""
12711314
"This class represents an action that should be run only after a certain "
12721315
"amount of time has passed --- a timer. :class:`Timer` is a subclass of :"
12731316
"class:`Thread` and as such also functions as an example of creating custom "
12741317
"threads."
12751318
msgstr ""
12761319

1277-
#: ../../library/threading.rst:1009
1320+
#: ../../library/threading.rst:1036
12781321
msgid ""
12791322
"Timers are started, as with threads, by calling their :meth:`Timer.start "
12801323
"<Thread.start>` method. The timer can be stopped (before its action has "
@@ -1283,32 +1326,32 @@ msgid ""
12831326
"interval specified by the user."
12841327
msgstr ""
12851328

1286-
#: ../../library/threading.rst:1015
1329+
#: ../../library/threading.rst:1042
12871330
msgid "For example::"
12881331
msgstr ""
12891332
"舉例來說:\n"
12901333
"\n"
12911334
"::"
12921335

1293-
#: ../../library/threading.rst:1026
1336+
#: ../../library/threading.rst:1053
12941337
msgid ""
12951338
"Create a timer that will run *function* with arguments *args* and keyword "
12961339
"arguments *kwargs*, after *interval* seconds have passed. If *args* is "
12971340
"``None`` (the default) then an empty list will be used. If *kwargs* is "
12981341
"``None`` (the default) then an empty dict will be used."
12991342
msgstr ""
13001343

1301-
#: ../../library/threading.rst:1036
1344+
#: ../../library/threading.rst:1063
13021345
msgid ""
13031346
"Stop the timer, and cancel the execution of the timer's action. This will "
13041347
"only work if the timer is still in its waiting stage."
13051348
msgstr ""
13061349

1307-
#: ../../library/threading.rst:1041
1350+
#: ../../library/threading.rst:1068
13081351
msgid "Barrier Objects"
13091352
msgstr ""
13101353

1311-
#: ../../library/threading.rst:1045
1354+
#: ../../library/threading.rst:1072
13121355
msgid ""
13131356
"This class provides a simple synchronization primitive for use by a fixed "
13141357
"number of threads that need to wait for each other. Each of the threads "
@@ -1317,108 +1360,108 @@ msgid ""
13171360
"calls. At this point, the threads are released simultaneously."
13181361
msgstr ""
13191362

1320-
#: ../../library/threading.rst:1051
1363+
#: ../../library/threading.rst:1078
13211364
msgid ""
13221365
"The barrier can be reused any number of times for the same number of threads."
13231366
msgstr ""
13241367

1325-
#: ../../library/threading.rst:1053
1368+
#: ../../library/threading.rst:1080
13261369
msgid ""
13271370
"As an example, here is a simple way to synchronize a client and server "
13281371
"thread::"
13291372
msgstr ""
13301373

1331-
#: ../../library/threading.rst:1073
1374+
#: ../../library/threading.rst:1100
13321375
msgid ""
13331376
"Create a barrier object for *parties* number of threads. An *action*, when "
13341377
"provided, is a callable to be called by one of the threads when they are "
13351378
"released. *timeout* is the default timeout value if none is specified for "
13361379
"the :meth:`wait` method."
13371380
msgstr ""
13381381

1339-
#: ../../library/threading.rst:1080
1382+
#: ../../library/threading.rst:1107
13401383
msgid ""
13411384
"Pass the barrier. When all the threads party to the barrier have called "
13421385
"this function, they are all released simultaneously. If a *timeout* is "
13431386
"provided, it is used in preference to any that was supplied to the class "
13441387
"constructor."
13451388
msgstr ""
13461389

1347-
#: ../../library/threading.rst:1085
1390+
#: ../../library/threading.rst:1112
13481391
msgid ""
13491392
"The return value is an integer in the range 0 to *parties* -- 1, different "
13501393
"for each thread. This can be used to select a thread to do some special "
13511394
"housekeeping, e.g.::"
13521395
msgstr ""
13531396

1354-
#: ../../library/threading.rst:1094
1397+
#: ../../library/threading.rst:1121
13551398
msgid ""
13561399
"If an *action* was provided to the constructor, one of the threads will have "
13571400
"called it prior to being released. Should this call raise an error, the "
13581401
"barrier is put into the broken state."
13591402
msgstr ""
13601403

1361-
#: ../../library/threading.rst:1098
1404+
#: ../../library/threading.rst:1125
13621405
msgid "If the call times out, the barrier is put into the broken state."
13631406
msgstr ""
13641407

1365-
#: ../../library/threading.rst:1100
1408+
#: ../../library/threading.rst:1127
13661409
msgid ""
13671410
"This method may raise a :class:`BrokenBarrierError` exception if the barrier "
13681411
"is broken or reset while a thread is waiting."
13691412
msgstr ""
13701413

1371-
#: ../../library/threading.rst:1105
1414+
#: ../../library/threading.rst:1132
13721415
msgid ""
13731416
"Return the barrier to the default, empty state. Any threads waiting on it "
13741417
"will receive the :class:`BrokenBarrierError` exception."
13751418
msgstr ""
13761419

1377-
#: ../../library/threading.rst:1108
1420+
#: ../../library/threading.rst:1135
13781421
msgid ""
13791422
"Note that using this function may require some external synchronization if "
13801423
"there are other threads whose state is unknown. If a barrier is broken it "
13811424
"may be better to just leave it and create a new one."
13821425
msgstr ""
13831426

1384-
#: ../../library/threading.rst:1114
1427+
#: ../../library/threading.rst:1141
13851428
msgid ""
13861429
"Put the barrier into a broken state. This causes any active or future calls "
13871430
"to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for "
13881431
"example if one of the threads needs to abort, to avoid deadlocking the "
13891432
"application."
13901433
msgstr ""
13911434

1392-
#: ../../library/threading.rst:1119
1435+
#: ../../library/threading.rst:1146
13931436
msgid ""
13941437
"It may be preferable to simply create the barrier with a sensible *timeout* "
13951438
"value to automatically guard against one of the threads going awry."
13961439
msgstr ""
13971440

1398-
#: ../../library/threading.rst:1125
1441+
#: ../../library/threading.rst:1152
13991442
msgid "The number of threads required to pass the barrier."
14001443
msgstr ""
14011444

1402-
#: ../../library/threading.rst:1129
1445+
#: ../../library/threading.rst:1156
14031446
msgid "The number of threads currently waiting in the barrier."
14041447
msgstr ""
14051448

1406-
#: ../../library/threading.rst:1133
1449+
#: ../../library/threading.rst:1160
14071450
msgid "A boolean that is ``True`` if the barrier is in the broken state."
14081451
msgstr ""
14091452

1410-
#: ../../library/threading.rst:1138
1453+
#: ../../library/threading.rst:1165
14111454
msgid ""
14121455
"This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:"
14131456
"`Barrier` object is reset or broken."
14141457
msgstr ""
14151458

1416-
#: ../../library/threading.rst:1145
1459+
#: ../../library/threading.rst:1172
14171460
msgid ""
14181461
"Using locks, conditions, and semaphores in the :keyword:`!with` statement"
14191462
msgstr ""
14201463

1421-
#: ../../library/threading.rst:1147
1464+
#: ../../library/threading.rst:1174
14221465
msgid ""
14231466
"All of the objects provided by this module that have ``acquire`` and "
14241467
"``release`` methods can be used as context managers for a :keyword:`with` "
@@ -1427,11 +1470,11 @@ msgid ""
14271470
"following snippet::"
14281471
msgstr ""
14291472

1430-
#: ../../library/threading.rst:1156
1473+
#: ../../library/threading.rst:1183
14311474
msgid "is equivalent to::"
14321475
msgstr ""
14331476

1434-
#: ../../library/threading.rst:1164
1477+
#: ../../library/threading.rst:1191
14351478
msgid ""
14361479
"Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, :class:"
14371480
"`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:"

‎whatsnew/3.12.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-05-10 00:04+0000\n"
10+
"POT-Creation-Date: 2024-05-23 00:03+0000\n"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2759,7 +2759,7 @@ msgstr ""
27592759
msgid ""
27602760
"Undocumented :meth:`TestLoader.loadTestsFromModule <unittest.TestLoader."
27612761
"loadTestsFromModule>` parameter *use_load_tests* (deprecated and ignored "
2762-
"since Python 3.2)."
2762+
"since Python 3.5)."
27632763
msgstr ""
27642764

27652765
#: ../../whatsnew/3.12.rst:1755

0 commit comments

Comments
 (0)
Please sign in to comment.