@@ -19,7 +19,7 @@ msgid ""
19
19
msgstr ""
20
20
"Project-Id-Version : Python 3.13\n "
21
21
"Report-Msgid-Bugs-To : \n "
22
- "POT-Creation-Date : 2025-01-24 14:16 +0000\n "
22
+ "POT-Creation-Date : 2025-02-14 14:17 +0000\n "
23
23
"PO-Revision-Date : 2021-06-28 00:50+0000\n "
24
24
"Last-Translator : Freesand Leo <yuqinju@163.com>, 2025\n "
25
25
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -1889,7 +1889,14 @@ msgstr ""
1889
1889
"*consumed* 不为 ``NULL``,则 :c:func:`PyUnicode_DecodeMBCSStateful` "
1890
1890
"将不会解码末尾的不完整字节并且已被解码的字节数将存储在 *consumed* 中。"
1891
1891
1892
- #: ../../c-api/unicode.rst:1357
1892
+ #: ../../c-api/unicode.rst:1358
1893
+ msgid ""
1894
+ "Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page"
1895
+ " specified by *code_page*."
1896
+ msgstr ""
1897
+ "类似于 :c:func:`PyUnicode_DecodeMBCSStateful`,区别在于使用由 *code_page* 所指定的代码页。"
1898
+
1899
+ #: ../../c-api/unicode.rst:1364
1893
1900
msgid ""
1894
1901
"Encode a Unicode object using MBCS and return the result as Python bytes "
1895
1902
"object. Error handling is \" strict\" . Return ``NULL`` if an exception was "
@@ -1898,7 +1905,7 @@ msgstr ""
1898
1905
"使用 MBCS 编码 Unicode 对象并将结果作为 Python 字节串对象返回。 错误处理方式为 \" strict\" 。 "
1899
1906
"如果编解码器引发了异常则将返回 ``NULL``。"
1900
1907
1901
- #: ../../c-api/unicode.rst:1364
1908
+ #: ../../c-api/unicode.rst:1371
1902
1909
msgid ""
1903
1910
"Encode the Unicode object using the specified code page and return a Python "
1904
1911
"bytes object. Return ``NULL`` if an exception was raised by the codec. Use "
@@ -1907,30 +1914,30 @@ msgstr ""
1907
1914
"使用指定的代码页编码 Unicode 对象并返回一个 Python 字节串对象。 如果编解码器引发了异常则返回 ``NULL``。 使用 "
1908
1915
":c:macro:`!CP_ACP` 代码页来获取 MBCS 解码器。"
1909
1916
1910
- #: ../../c-api/unicode.rst:1372
1917
+ #: ../../c-api/unicode.rst:1379
1911
1918
msgid "Methods & Slots"
1912
1919
msgstr "方法和槽位"
1913
1920
1914
- #: ../../c-api/unicode.rst:1378
1921
+ #: ../../c-api/unicode.rst:1385
1915
1922
msgid "Methods and Slot Functions"
1916
1923
msgstr "方法与槽位函数"
1917
1924
1918
- #: ../../c-api/unicode.rst:1380
1925
+ #: ../../c-api/unicode.rst:1387
1919
1926
msgid ""
1920
1927
"The following APIs are capable of handling Unicode objects and strings on "
1921
1928
"input (we refer to them as strings in the descriptions) and return Unicode "
1922
F438
code>
1929
"objects or integers as appropriate."
1923
1930
msgstr "以下 API 可以处理输入的 Unicode 对象和字符串(在描述中我们称其为字符串)并返回适当的 Unicode 对象或整数值。"
1924
1931
1925
- #: ../../c-api/unicode.rst:1384
1932
+ #: ../../c-api/unicode.rst:1391
1926
1933
msgid "They all return ``NULL`` or ``-1`` if an exception occurs."
1927
1934
msgstr "如果发生异常它们都将返回 ``NULL`` 或 ``-1``。"
1928
1935
1929
- #: ../../c-api/unicode.rst:1389
1936
+ #: ../../c-api/unicode.rst:1396
1930
1937
msgid "Concat two strings giving a new Unicode string."
1931
1938
msgstr "拼接两个字符串得到一个新的 Unicode 字符串。"
1932
1939
1933
- #: ../../c-api/unicode.rst:1394
1940
+ #: ../../c-api/unicode.rst:1401
1934
1941
msgid ""
1935
1942
"Split a string giving a list of Unicode strings. If *sep* is ``NULL``, "
1936
1943
"splitting will be done at all whitespace substrings. Otherwise, splits "
@@ -1941,7 +1948,7 @@ msgstr ""
1941
1948
"拆分一个字符串得到一个 Unicode 字符串的列表。 如果 *sep* 为 ``NULL``,则将根据空格来拆分所有子字符串。 "
1942
1949
"否则,将根据指定的分隔符来拆分。 最多拆分数为 *maxsplit*。 如为负值,则没有限制。 分隔符不包括在结果列表中。"
1943
1950
1944
- #: ../../c-api/unicode.rst:1402
1951
+ #: ../../c-api/unicode.rst:1409
1945
1952
msgid ""
1946
1953
"Split a Unicode string at line breaks, returning a list of Unicode strings. "
1947
1954
"CRLF is considered to be one line break. If *keepends* is ``0``, the Line "
@@ -1950,13 +1957,13 @@ msgstr ""
1950
1957
"根据分行符来拆分 Unicode 字符串,返回一个 Unicode 字符串的列表。 CRLF 将被视为一个分行符。 如果 *keepends* 为 "
1951
1958
"``0``,则行分隔符将不包括在结果字符串中。"
1952
1959
1953
- #: ../../c-api/unicode.rst:1409
1960
+ #: ../../c-api/unicode.rst:1416
1954
1961
msgid ""
1955
1962
"Join a sequence of strings using the given *separator* and return the "
1956
1963
"resulting Unicode string."
1957
1964
msgstr "使用给定的 *separator* 合并一个字符串列表并返回结果 Unicode 字符串。"
1958
1965
1959
- #: ../../c-api/unicode.rst:1416
1966
+ #: ../../c-api/unicode.rst:1423
1960
1967
msgid ""
1961
1968
"Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail "
1962
1969
"end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` "
@@ -1965,7 +1972,7 @@ msgstr ""
1965
1972
"如果 *substr* 在给定的端点 (*direction* == ``-1`` 表示前缀匹配, *direction* == ``1`` "
1966
1973
"表示后缀匹配) 与 ``unicode[start:end]`` 相匹配则返回 ``1``,否则返回 ``0``。 如果发生错误则返回 ``-1``。"
1967
1974
1968
- #: ../../c-api/unicode.rst:1424
1975
+ #: ../../c-api/unicode.rst:1431
1969
1976
msgid ""
1970
1977
"Return the first position of *substr* in ``unicode[start:end]`` using the "
1971
1978
"given *direction* (*direction* == ``1`` means to do a forward search, "
@@ -1977,7 +1984,7 @@ msgstr ""
1977
1984
"表示后向搜索) 时 *substr* 在 ``unicode[start:end]`` 中首次出现的位置。 返回值为首个匹配的索引号;值为 ``-1``"
1978
1985
" 表示未找到匹配,``-2`` 则表示发生了错误并设置了异常。"
1979
1986
1980
- #: ../../c-api/unicode.rst:1434
1987
+ #: ../../c-api/unicode.rst:1441
1981
1988
msgid ""
1982
1989
"Return the first position of the character *ch* in ``unicode[start:end]`` "
1983
1990
"using the given *direction* (*direction* == ``1`` means to do a forward "
@@ -1990,18 +1997,18 @@ msgstr ""
1990
1997
"表示后向搜索) 时字符 *ch* 在 ``unicode[start:end]`` 中首次出现的位置。 返回值为首个匹配的索引号;值为 ``-1`` "
1991
1998
"表示未找到匹配,``-2`` 则表示发生错误并设置了异常。"
1992
1999
1993
- #: ../../c-api/unicode.rst:1442
2000
+ #: ../../c-api/unicode.rst:1449
1994
2001
msgid ""
1995
2002
"*start* and *end* are now adjusted to behave like ``unicode[start:end]``."
1996
2003
msgstr "现在 *start* 和 *end* 被调整为与 ``unicode[start:end]`` 类似的行为。"
1997
2004
1998
- #: ../../c-api/unicode.rst:1449
2005
+ #: ../../c-api/unicode.rst:1456
1999
2006
msgid ""
2000
2007
"Return the number of non-overlapping occurrences of *substr* in "
2001
2008
"``unicode[start:end]``. Return ``-1`` if an error occurred."
2002
2009
msgstr "返回 *substr* 在 ``unicode[start:end]`` 中不重叠出现的次数。 如果发生错误则返回 ``-1``。"
2003
2010
2004
- #: ../../c-api/unicode.rst:1456
2011
+ #: ../../c-api/unicode.rst:1463
2005
2012
msgid ""
2006
2013
"Replace at most *maxcount* occurrences of *substr* in *unicode* with "
2007
2014
"*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` "
@@ -2010,19 +2017,19 @@ msgstr ""
2010
2017
"将 *unicode* 中 *substr* 替换为 *replstr* 至多 *maxcount* 次并返回结果 Unicode 对象。 "
2011
2018
"*maxcount* == ``-1`` 表示全部替换。"
2012
2019
2013
- #: ../../c-api/unicode.rst:1463
2020
+ #: ../../c-api/unicode.rst:1470
2014
2021
msgid ""
2015
2022
"Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, "
2016
2023
"and greater than, respectively."
2017
2024
msgstr "比较两个字符串并返回 ``-1``, ``0``, ``1`` 分别表示小于、等于和大于。"
2018
2025
2019
- #: ../../c-api/unicode.rst:1466
2026
+ #: ../../c-api/unicode.rst:1473
2020
2027
msgid ""
2021
2028
"This function returns ``-1`` upon failure, so one should call "
2022
2029
":c:func:`PyErr_Occurred` to check for errors."
2023
2030
msgstr "此函数执行失败时返回 ``-1``,因此应当调用 :c:func:`PyErr_Occurred` 来检查错误。"
2024
2031
2025
- #: ../../c-api/unicode.rst:1472
2032
+ #: ../../c-api/unicode.rst:1479
2026
2033
msgid ""
2027
2034
"Compare a Unicode object with a char buffer which is interpreted as being "
2028
2035
"UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false "
@@ -2034,11 +2041,11 @@ msgstr ""
2034
2041
"(``0``)。 如果 Unicode 对象包含代理码位 (``U+D800`` - ``U+DFFF``) 或者如果 C 字符串不是有效的 UTF-8"
2035
2042
" 编码,则返回假值 (``0``)。"
2036
2043
2037
- #: ../../c-api/unicode.rst:1479 ../../c-api/unicode.rst:1500
2044
+ #: ../../c-api/unicode.rst:1486 ../../c-api/unicode.rst:1507
2038
2045
msgid "This function does not raise exceptions."
2039
2046
msgstr "此函数不会引发异常。"
2040
2047
2041
- #: ../../c-api/unicode.rst:1486
2048
+ #: ../../c-api/unicode.rst:1493
2042
2049
msgid ""
2043
2050
"Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* "
2044
2051
"length using :c:func:`!strlen`. If the Unicode object contains null "
@@ -2047,7 +2054,7 @@ msgstr ""
2047
2054
"类似于 :c:func:`PyUnicode_EqualToUTF8AndSize`,但会使用 :c:func:`!strlen` 来计算 "
2048
2055
"*string* 的长度。 如果 Unicode 对象包含空字符,则返回假值 (``0``)。"
2049
2056
2050
- #: ../../c-api/unicode.rst:1495
2057
+ #: ../../c-api/unicode.rst:1502
2051
2058
msgid ""
2052
2059
"Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``,"
2053
2060
" ``1`` for less than, equal, and greater than, respectively. It is best to "
@@ -2057,49 +2064,49 @@ msgstr ""
2057
2064
"将 Unicode 对象 *unicode* 与 *string* 进行比较并返回 ``-1``, ``0``, ``1`` 分别表示小于、等于和大于。"
2058
2065
" 最好只传入 ASCII 编码的字符串,但如果输入字符串包含非 ASCII 字符则此函数会将其按 ISO-8859-1 编码格式来解读。"
2059
2066
2060
- #: ../../c-api/unicode.rst:1505
2067
+ #: ../../c-api/unicode.rst:1512
2061
2068
msgid "Rich compare two Unicode strings and return one of the following:"
2062
2069
7802
msgstr "对两个 Unicode 字符串执行富比较并返回以下值之一:"
2063
2070
2064
- #: ../../c-api/unicode.rst:1507
2071
+ #: ../../c-api/unicode.rst:1514
2065
2072
msgid "``NULL`` in case an exception was raised"
2066
2073
msgstr "``NULL`` 用于引发了异常的情况"
2067
2074
2068
- #: ../../c-api/unicode.rst:1508
2075
+ #: ../../c-api/unicode.rst:1515
2069
2076
msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons"
2070
2077
msgstr ":c:data:`Py_True` 或 :c:data:`Py_False` 用于成功完成比较的情况"
2071
2078
2072
- #: ../../c-api/unicode.rst:1509
2079
+ #: ../../c-api/unicode.rst:1516
2073
2080
msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown"
2074
2081
msgstr ":c:data:`Py_NotImplemented` 用于类型组合未知的情况"
2075
2082
2076
- #: ../../c-api/unicode.rst:1511
2083
+ #: ../../c-api/unicode.rst:1518
2077
2084
msgid ""
2078
2085
"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, "
2079
2086
":c:macro:`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`."
2080
2087
msgstr ""
2081
2088
"可能的 *op* 值有 :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:`Py_EQ`, "
2082
2089
":c:macro:`Py_NE`, :c:macro:`Py_LT`, 和 :c:macro:`Py_LE`。"
2083
2090
2084
- #: ../../c-api/unicode.rst:1517
2091
+ #: ../../c-api/unicode.rst:1524
2085
2092
msgid ""
2086
2093
"Return a new string object from *format* and *args*; this is analogous to "
2087
2094
"``format % args``."
2088
2095
msgstr "根据 *format* 和 *args* 返回一个新的字符串对象;这等同于 ``format % args``。"
2089
2096
2090
- #: ../../c-api/unicode.rst:1523
2097
+ #: ../../c-api/unicode.rst:1530
2091
2098
msgid ""
2092
2099
"Check whether *substr* is contained in *unicode* and return true or false "
2093
2100
"accordingly."
2094
2101
msgstr "检查 *substr* 是否包含在 *unicode* 中并相应返回真值或假值。"
2095
2102
2096
- #: ../../c-api/unicode.rst:1526
2103
+ #: ../../c-api/unicode.rst:1533
2097
2104
msgid ""
2098
2105
"*substr* has to coerce to a one element Unicode string. ``-1`` is returned "
2099
2106
"if there was an error."
2100
2107
msgstr "*substr* 必须强制转为一个单元素 Unicode 字符串。 如果发生错误则返回 ``-1``。"
2101
2108
2102
- #: ../../c-api/unicode.rst:1532
2109
+ #: ../../c-api/unicode.rst:1539
2103
2110
msgid ""
2104
2111
"Intern the argument :c:expr:`*p_unicode` in place. The argument must be the"
2105
2112
" address of a pointer variable pointing to a Python Unicode string object. "
@@ -2114,7 +2121,7 @@ msgstr ""
2114
2121
"(释放对旧字符串的引用并新建一个指向该内部化字符串对象的 :term:`strong reference`),否则将保持 "
2115
2122
":c:expr:`*p_unicode` 不变并将其内部化。"
2116
2123
2117
- #: ../../c-api/unicode.rst:1539
2124
+ #: ../../c-api/unicode.rst:1546
2118
2125
msgid ""
2119
2126
"(Clarification: even though there is a lot of talk about references, think "
2120
2127
"of this function as reference-neutral. You must own the object you pass in; "
@@ -2123,13 +2130,13 @@ msgid ""
2123
2130
msgstr ""
2124
2131
"(澄清说明:虽然这里大量提及了引用,但请将此函数视为引用无关的。你必须拥有你传入的对象;在调用之后你将不再拥有传入的引用,但你将新拥有结果对象。)"
2125
2132
2126
- #: ../../c-api/unicode.rst:1544
2133
+ #: ../../c-api/unicode.rst:1551
2127
2134
msgid ""
2128
2135
"This function never raises an exception. On error, it leaves its argument "
2129
2136
"unchanged without interning it."
2130
2137
msgstr "此函数绝不会引发异常。 在发生错误时,它将保持其参数不变而不会将其内部化。"
2131
2138
2132
- #: ../../c-api/unicode.rst:1547
2139
+ #: ../../c-api/unicode.rst:1554
2133
2140
msgid ""
2134
2141
"Instances of subclasses of :py:class:`str` may not be interned, that is, "
2135
2142
":c:expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then "
@@ -2138,28 +2145,28 @@ msgstr ""
2138
2145
":py:class:`str` 的子类的实例不可被内部化,也就是说,:c:expr:`PyUnicode_CheckExact(*p_unicode)`"
2139
2146
" 必须为真值。 如果其不为真值,那么 -- 就像发生其他错误时一样 -- 该参数将保持不变。"
2140
2147
2141
- #: ../../c-api/unicode.rst:1551
2148
+ #: ../../c-api/unicode.rst:1558
2142
2149
msgid ""
2143
2150
"Note that interned strings are not “immortal”. You must keep a reference to "
2144
2151
"the result to benefit from interning."
2145
2152
msgstr "请注意被内部化的字符串不是“永生的”。 你必须保留对结果的引用才能从内部化获益。"
2146
2153
2147
- #: ../../c-api/unicode.rst:1557
2154
+ #: ../../c-api/unicode.rst:1564
2148
2155
msgid ""
2149
2156
"A combination of :c:func:`PyUnicode_FromString` and "
2150
2157
":c:func:`PyUnicode_InternInPlace`, meant for statically allocated strings."
2151
2158
msgstr ""
2152
2159
":c:func:`PyUnicode_FromString` 和 :c:func:`PyUnicode_InternInPlace` "
2153
2160
"的结合,用于静态分配的字符串。"
2154
2161
2155
- #: ../../c-api/unicode.rst:1560
2162
+ #: ../../c-api/unicode.rst:1567
2156
2163
msgid ""
2157
2164
"Return a new (\" owned\" ) reference to either a new Unicode string object "
2158
2165
"that has been interned, or an earlier interned string object with the same "
2159
2166
"value."
2160
2167
msgstr "返回一个新的(“拥有的”)引用,它指向一个已被内部化的新 Unicode 字符串,或一个具有相同值的先前已被内部化的字符串对象。"
2161
2168
2162
- #: ../../c-api/unicode.rst:1564
2169
+ #: ../../c-api/unicode.rst:1571
2163
2170
msgid ""
2164
2171
"Python may keep a reference to the result, or make it :term:`immortal`, "
2165
2172
"preventing it from being garbage-collected promptly. For interning an "
@@ -2171,6 +2178,6 @@ msgstr ""
2171
2178
"对于内部化未限定数量的不同字符串,例如来自用户输入的字符串,建议直接调用 :c:func:`PyUnicode_FromString` 和 "
2172
2179
":c:func:`PyUnicode_InternInPlace`。"
2173
2180
2174
- #: ../../c-api/unicode.rst:1572
2181
+ #: ../../c-api/unicode.rst:1579
2175
2182
msgid "Strings interned this way are made :term:`immortal`."
2176
2183
msgstr "用此方式被内部化的字符串将成为 :term:`immortal` 对象。"
0 commit comments