6
6
msgstr ""
7
7
"Project-Id-Version : Python 3.13\n "
8
8
"Report-Msgid-Bugs-To : \n "
9
- "POT-Creation-Date : 2025-02-23 00:15+0000\n "
9
+ "POT-Creation-Date : 2025-04-14 00:15+0000\n "
10
10
"PO-Revision-Date : 2018-05-23 14:39+0000\n "
11
11
"
Last-Translator :
Adrian Liaw <[email protected] >\n "
12
12
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -1779,12 +1779,18 @@ msgstr ""
1779
1779
1780
1780
#: ../../library/asyncio-task.rst:1339
1781
1781
msgid ""
1782
- "This arranges for a :exc:`CancelledError` exception to be thrown into the "
1783
- "wrapped coroutine on the next cycle of the event loop ."
1782
+ "If the Task is already *done* or *cancelled*, return ``False``, otherwise, "
1783
+ "return ``True`` ."
1784
1784
msgstr ""
1785
1785
1786
1786
#: ../../library/asyncio-task.rst:1342
1787
1787
msgid ""
1788
+ "The method arranges for a :exc:`CancelledError` exception to be thrown into "
1789
+ "the wrapped coroutine on the next cycle of the event loop."
1790
+ msgstr ""
1791
+
1792
+ #: ../../library/asyncio-task.rst:1345
1793
+ msgid ""
1788
1794
"The coroutine then has a chance to clean up or even deny the request by "
1789
1795
"suppressing the exception with a :keyword:`try` ... ... ``except "
1790
1796
"CancelledError`` ... :keyword:`finally` block. Therefore, unlike :meth:"
@@ -1795,21 +1801,21 @@ msgid ""
1795
1801
"addition to catching the exception."
1796
1802
msgstr ""
1797
1803
1798
- #: ../../library/asyncio-task.rst:1352
1804
+ #: ../../library/asyncio-task.rst:1355
1799
1805
msgid "Added the *msg* parameter."
1800
1806
msgstr "新增 *msg* 參數。"
1801
1807
1802
- #: ../../library/asyncio-task.rst:1355
1808
+ #: ../../library/asyncio-task.rst:1358
1803
1809
msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter."
1804
1810
msgstr ""
1805
1811
1806
- #: ../../library/asyncio-task.rst:1360
1812
+ #: ../../library/asyncio-task.rst:1363
1807
1813
msgid ""
1808
1814
"The following example illustrates how coroutines can intercept the "
1809
1815
"cancellation request::"
1810
1816
msgstr ""
1811
1817
1812
- #: ../../library/asyncio-task.rst:1363
1818
+ #: ../../library/asyncio-task.rst:1366
1813
1819
msgid ""
1814
1820
"async def cancel_me():\n"
1815
1821
" print('cancel_me(): before sleep')\n"
@@ -1846,32 +1852,32 @@ msgid ""
1846
1852
"# main(): cancel_me is cancelled now"
1847
1853
msgstr ""
1848
1854
1849
- #: ../../library/asyncio-task.rst:1399
1855
+ #: ../../library/asyncio-task.rst:1402
1850
1856
msgid "Return ``True`` if the Task is *cancelled*."
1851
1857
msgstr ""
1852
1858
1853
- #: ../../library/asyncio-task.rst:1401
1859
+ #: ../../library/asyncio-task.rst:1404
1854
1860
msgid ""
1855
1861
"The Task is *cancelled* when the cancellation was requested with :meth:"
1856
1862
"`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` "
1857
1863
"exception thrown into it."
1858
1864
msgstr ""
1859
1865
1860
- #: ../../library/asyncio-task.rst:1407
1866
+ #: ../../library/asyncio-task.rst:1410
1861
1867
msgid "Decrement the count of cancellation requests to this Task."
1862
1868
msgstr ""
1863
1869
1864
- #: ../../library/asyncio-task.rst:1409
1870
+ #: ../../library/asyncio-task.rst:1412
1865
1871
msgid "Returns the remaining number of cancellation requests."
1866
1872
msgstr ""
1867
1873
1868
- #: ../../library/asyncio-task.rst:1411
1874
+ #: ../../library/asyncio-task.rst:1414
1869
1875
msgid ""
1870
1876
"Note that once execution of a cancelled task completed, further calls to :"
1871
1877
"meth:`uncancel` are ineffective."
1872
1878
msgstr ""
1873
1879
1874
- #: ../../library/asyncio-task.rst:1416
1880
+ #: ../../library/asyncio-task.rst:1419
1875
1881
msgid ""
1876
1882
"This method is used by asyncio's internals and isn't expected to be used by "
1877
1883
"end-user code. In particular, if a Task gets successfully uncancelled, this "
@@ -1880,7 +1886,7 @@ msgid ""
1880
1886
"respective structured block. For example::"
1881
1887
msgstr ""
1882
1888
1883
- #: ../../library/asyncio-task.rst:1423
1889
+ #: ../../library/asyncio-task.rst:1426
1884
1890
msgid ""
1885
1891
"async def make_request_with_timeout():\n"
1886
1892
" try:\n"
@@ -1894,7 +1900,7 @@ msgid ""
1894
1900
" await unrelated_code()"
1895
1901
msgstr ""
1896
1902
1897
- #: ../../library/asyncio-task.rst:1434
1903
+ #: ../../library/asyncio-task.rst:1437
1898
1904
msgid ""
1899
1905
"While the block with ``make_request()`` and ``make_another_request()`` might "
1900
1906
"get cancelled due to the timeout, ``unrelated_code()`` should continue "
@@ -1903,14 +1909,14 @@ msgid ""
1903
1909
"similar fashion."
1904
1910
msgstr ""
1905
1911
1906
- #: ../../library/asyncio-task.rst:1440
1912
+ #: ../../library/asyncio-task.rst:1443
1907
1913
msgid ""
1908
1914
"If end-user code is, for some reason, suppressing cancellation by catching :"
1909
1915
"exc:`CancelledError`, it needs to call this method to remove the "
1910
1916
"cancellation state."
1911
1917
msgstr ""
1912
1918
1913
- #: ../../library/asyncio-task.rst:1444
1919
+ #: ../../library/asyncio-task.rst:1447
1914
1920
msgid ""
1915
1921
"When this method decrements the cancellation count to zero, the method "
1916
1922
"checks if a previous :meth:`cancel` call had arranged for :exc:"
@@ -1919,17 +1925,17 @@ msgid ""
1919
1925
"``_must_cancel`` flag)."
1920
1926
msgstr ""
1921
1927
1922
- #: ../../library/asyncio-task.rst:1450
1928
+ #: ../../library/asyncio-task.rst:1453
1923
1929
msgid "Changed to rescind pending cancellation requests upon reaching zero."
1924
1930
msgstr ""
1925
1931
1926
- #: ../../library/asyncio-task.rst:1455
1932
+ #: ../../library/asyncio-task.rst:1458
1927
1933
msgid ""
1928
1934
"Return the number of pending cancellation requests to this Task, i.e., the "
1929
1935
"number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls."
1930
1936
msgstr ""
1931
1937
1932
- #: ../../library/asyncio-task.rst:1459
1938
+ #: ../../library/asyncio-task.rst:1462
1933
1939
msgid ""
1934
1940
"Note that if this number is greater than zero but the Task is still "
1935
1941
"executing, :meth:`cancelled` will still return ``False``. This is because "
@@ -1938,7 +1944,7 @@ msgid ""
1938
1944
"to zero."
1939
1945
msgstr ""
1940
1946
1941
- #: ../../library/asyncio-task.rst:1465
1947
+ #: ../../library/asyncio-task.rst:1468
1942
1948
msgid ""
1943
1949
"This method is used by asyncio's internals and isn't expected to be used by "
1944
1950
"end-user code. See :meth:`uncancel` for more details."
0 commit comments