8000 [po] auto sync · python/python-docs-zh-cn@8550bd4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8550bd4

Browse files
[po] auto sync
1 parent 56ed744 commit 8550bd4

File tree

3 files changed

+62
-12
lines changed

3 files changed

+62
-12
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "81.17%", "updated_at": "2025-03-30T06:55:24Z"}
1+
{"translation": "81.20%", "updated_at": "2025-03-30T07:55:33Z"}

library/token.po

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ msgid ""
5454
"``\"+\"`` token may be reported as either :data:`PLUS` or :data:`OP`, or a "
5555
"``\"match\"`` token may be either :data:`NAME` or :data:`SOFT_KEYWORD`."
5656
msgstr ""
57+
"请注意一个词元的值可能取决于分词器选项。 例如,``\"+\"`` 词元可能被报告为 :data:`PLUS` 或 :data:`OP`,而 "
58+
"``\"match\"`` 词元可能被报告为 :data:`NAME` 或 :data:`SOFT_KEYWORD`。"
5759

5860
#: ../../library/token.rst:29
5961
msgid ""
@@ -82,11 +84,11 @@ msgstr "形符常量有:"
8284
msgid ""
8385
"Token value that indicates an :ref:`identifier <identifiers>`. Note that "
8486
"keywords are also initially tokenized an ``NAME`` tokens."
85-
msgstr ""
87+
msgstr "表示一个 :ref:`标识符 <identifiers>` 的词元值。 请注意关键字也会被初始分词化为 ``NAME`` 词元。"
8688

8789
#: ../../library/token.rst:58
8890
msgid "Token value that indicates a :ref:`numeric literal <numbers>`"
89-
msgstr ""
91+
msgstr "表示一个 :ref:`数字字面值 <numbers>` 的词元值。"
9092

9193
#: ../../library/token.rst:62
9294
msgid ""
@@ -96,86 +98,95 @@ msgid ""
9698
"(if given); backslashes are included literally, without processing escape "
9799
"sequences."
98100
msgstr ""
101+
"表示一个 :ref:`字符串或字节串字面值 <strings>` 的词元值,不包括 :ref:`格式化字符串字面值 <f-strings>`。 "
102+
"该词元字符串不会被解读:它包括两边的引号以及前缀(如果有的话);反斜杠将按照字面值被包括,而不会处理转义序列。"
99103

100104
#: ../../library/token.rst:70
101105
msgid ""
102106
"A generic token value that indicates an :ref:`operator <operators>` or "
103107
":ref:`delimiter <delimiters>`."
104-
msgstr ""
108+
msgstr "表示一个 :ref:`运算符 <operators>` 或 :ref:`分隔符 <delimiters>` 的泛用词元。"
105109

106110
#: ../../library/token.rst:75
107111
msgid ""
108112
"This value is only reported by the :mod:`tokenize` module. Internally, the "
109113
"tokenizer uses :ref:`exact token types <token_operators_delimiters>` "
110114
"instead."
111115
msgstr ""
116+
"这个值仅会由 :mod:`tokenize` 模块报告。 在内部,分词器会改用 :ref:`实际词元类型 "
117+
"<token_operators_delimiters>`。"
112118

113119
#: ../../library/token.rst:81
114120
msgid ""
115121
"Token value used to indicate a comment. The parser ignores :data:`!COMMENT` "
116122
"tokens."
117-
msgstr ""
123+
msgstr "用于表示注释的词元值。 解析器会忽略 :data:`!COMMENT` 词元。"
118124

119125
#: ../../library/token.rst:86
120126
msgid ""
121127
"Token value that indicates the end of a :ref:`logical line <logical-lines>`."
122-
msgstr ""
128+
msgstr "表示一个 :ref:`逻辑行 <logical-lines>` 结束的词元值。"
123129

124130
#: ../../library/token.rst:90
125131
msgid ""
126132
"Token value used to indicate a non-terminating newline. :data:`!NL` tokens "
127133
"are generated when a logical line of code is continued over multiple "
128134
"physical lines. The parser ignores :data:`!NL` tokens."
129135
msgstr ""
136+
"用于表示非终结换行符的词元值。 :data:`!NL` 词元会在一个代码逻辑行跨越了多个物理行时被生成。 解析器会忽略 :data:`!NL` 词元。"
130137

131138
#: ../../library/token.rst:96
132139
msgid ""
133140
"Token value used at the beginning of a :ref:`logical line <logical-lines>` "
134141
"to indicate the start of an :ref:`indented block <indentation>`."
135142
msgstr ""
143+
"用于在一个 :ref:`逻辑行 <logical-lines>` 的开头表示 :ref:`缩进块 <indentation>` 的开始的词元值。"
136144

137145
#: ../../library/token.rst:101
138146
msgid ""
139147
"Token value used at the beginning of a :ref:`logical line <logical-lines>` "
140148
"to indicate the end of an :ref:`indented block <indentation>`."
141149
msgstr ""
150+
"用于在一个 :ref:`逻辑行 <logical-lines>` 的开头表示 :ref:`缩进块 <indentation>` 的结束的词元值。"
142151

143152
#: ../../library/token.rst:106
144153
msgid ""
145154
"Token value used to indicate the beginning of an :ref:`f-string literal "
146155
"<f-strings>`."
147-
msgstr ""
156+
msgstr "用于表示一个 :ref:`格式化字符串字面值 <f-strings>` 的开始的词元值。"
148157

149158
#: ../../library/token.rst:111
150159
msgid ""
151160
"The token string includes the prefix and the opening quote(s), but none of "
152161
"the contents of the literal."
153-
msgstr ""
162+
msgstr "该词元值包括前缀和开始引号,但不包括字面值的内容。"
154163

155164
#: ../../library/token.rst:116
156165
msgid ""
157166
"Token value used for literal text inside an :ref:`f-string literal "
158167
"<f-strings>`, including format specifications."
159-
msgstr ""
168+
msgstr "用于一个 :ref:`格式化字面值 <f-strings>` 内部的字面文本包括格式说明的词元值。"
160169

161170
#: ../../library/token.rst:121
162171
msgid ""
163172
"Replacement fields (that is, the non-literal parts of f-strings) use the "
164173
"same tokens as other expressions, and are delimited by :data:`LBRACE`, "
165174
":data:`RBRACE`, :data:`EXCLAMATION` and :data:`COLON` tokens."
166175
msgstr ""
176+
"替换字段(即格式化字符串的非字面值部分)使用与其他表达式相同的词元,并由 :data:`LBRACE`, :data:`RBRACE`, "
177+
":data:`EXCLAMATION` 和 :data:`COLON` 词元来分隔。"
167178

168179
#: ../../library/token.rst:128
169180
msgid "Token value used to indicate the end of a :ref:`f-string <f-strings>`."
170-
msgstr ""
181+
msgstr "用于表示一个 :ref:`格式化字符串 <f-strings>` 的结束的词元值。"
171182

172183
#: ../../library/token.rst:132
173184
msgid "The token string contains the closing quote(s)."
174-
msgstr ""
185+
msgstr "该词元字符串包含结束引号。"
175186

176187
#: ../../library/token.rst:136
177188
msgid "Token value that indicates the end of input."
178-
msgstr ""
189+
msgstr "表示输入结束的词元值。"
179190

180191
#: ../../library/token.rst:140
181192
msgid ""

reference/datamodel.po

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,6 +2961,10 @@ msgid ""
29612961
":meth:`!__len__` nor :meth:`!__bool__` (which is true of the :class:`object`"
29622962
" class itself), all its instances are considered true."
29632963
msgstr ""
2964+
"调用此方法以实现真值检测以及内置的 ``bool()`` 操作;应当返回 ``False`` 或 ``True``。 当未定义此方法时,则会在定义了 "
2965+
":meth:`~object.__len__` 的情况下调用它,如果其结果不为零则该对象将被视为具有真值。 如果一个类的 "
2966+
":meth:`!__len__` 和 :meth:`!__bool__` 均未定义(这也是 :class:`object` "
2967+
"类本身的情况),则其所有实例都将被视为具有真值。"
29642968

29652969
#: ../../reference/datamodel.rst:2210
29662970
msgid "Customizing attribute access"
@@ -2983,6 +2987,10 @@ msgid ""
29832987
"attribute value or raise an :exc:`AttributeError` exception. The "
29842988
":class:`object` class itself does not provide this method."
29852989
msgstr ""
2990+
"当默认属性访问因引发 :exc:`AttributeError` 而失败时被调用 (可能是调用 :meth:`__getattribute__` 时由于"
2991+
" *name* 不是一个实例属性或 ``self`` 的类层级树中的属性而引发了 :exc:`AttributeError`;或者是由于 *name* "
2992+
"特征属性的 :meth:`__get__` 引发了 :exc:`AttributeError`)。 此方法应当返回(找到的)属性值或是引发一个 "
2993+
":exc:`AttributeError` 异常。 :class:`object` 类本身没有提供此方法。"
29862994

29872995
#: ../../reference/datamodel.rst:2228
29882996
msgid ""
@@ -3191,6 +3199,9 @@ msgid ""
31913199
" the owner class' :attr:`~object.__dict__`. The :class:`object` class "
31923200
"itself does not implement any of these protocols."
31933201
msgstr ""
3202+
"下列方法仅当一个包含该方法的类(即所谓 *描述器* 类)的实例出现在一个 *所有者* "
3203+
"类之中的时候才会起作用(该描述器必须在所有者类或它的某个上级类的类字典中)。 在下面的例子中,“属性”是指名称为所有者类的 "
3204+
":attr:`~object.__dict__` 中的特征属性的键名的属性。 :class:`object` 类本身没有实现这些协议。"
31943205

31953206
#: ../../reference/datamodel.rst:2370
31963207
msgid ""
@@ -3476,6 +3487,9 @@ msgid ""
34763487
":attr:`~object.__dict__` and *__weakref__* unless the subclass also defines "
34773488
"*__slots__* (which should only contain names of any *additional* slots)."
34783489
msgstr ""
3490+
"*__slots__* 声明的作用不只限于定义它的类。 在父类中声明的 *__slots__* 在其子类中同样可用。 不过,子类的实例将会获得 "
3491+
":attr:`~object.__dict__` 和 *__weakref__*,除非子类也定义了 *__slots__* (它应当只包含 *附加* "
3492+
"槽位的名称)。"
34793493

34803494
#: ../../reference/datamodel.rst:2565
34813495
msgid ""
@@ -4037,6 +4051,9 @@ msgid ""
40374051
"the context of adding Abstract Base Classes (see the :mod:`abc` module) to "
40384052
"the language."
40394053
msgstr ""
4054+
"包括通过 :meth:`~type.__instancecheck__` 和 :meth:`~type.__subclasscheck__` 来定制 "
4055+
":func:`isinstance` 和 :func:`issubclass` 行为的说明,加入此功能的动机是出于向语言添加抽象基类的场景(参见 "
4056+
":mod:`abc` 模块)。"
40404057

40414058
#: ../../reference/datamodel.rst:2906
40424059
msgid "Emulating generic types"
@@ -4323,6 +4340,8 @@ msgid ""
43234340
"defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, "
43244341
"arg1, ...)``. The :class:`object` class itself does not provide this method."
43254342
msgstr ""
4343+
"此方法会在实例作为一个函数被“调用”时被调用;如果定义了此方法,则 ``x(arg1, arg2, ...)`` 大致可以被转写为 "
4344+
"``type(x).__call__(x, arg1, ...)``。 :class:`object` 类本身没有提供此方法。"
43264345

43274346
#: ../../reference/datamodel.rst:3064
43284347
msgid "Emulating container types"
@@ -4365,6 +4384,26 @@ msgid ""
43654384
"container; for mappings, :meth:`!__iter__` should iterate through the "
43664385
"object's keys; for sequences, it should iterate through the values."
43674386
msgstr ""
4387+
"可以定义下列方法来实现容器对象。 :class:`object` 类本身没有提供它们。 容器通常是 :term:`序列 <sequence>` (如 "
4388+
":class:`列表 <list>` 或 :class:`元组 <tuple>`) 或者 :term:`映射 <mapping>` (如 "
4389+
":term:`字典 <dictionary>`),但也存在其他的容器表示形式。 "
4390+
"前面的一组方法被用来模拟序列或模拟映射;两者的区别在于序列所允许的键应为整数 *k* 且 ``0 <= k < N`` 其中 *N* "
4391+
"为整个序列或者定义条目范围的 :class:`slice` 对象的长度。 此外还建议让映射提供 :meth:`!keys`, "
4392+
":meth:`!values`, :meth:`!items`, :meth:`!get`, :meth:`!clear`, "
4393+
":meth:`!setdefault`, :meth:`!pop`, :meth:`!popitem`, :meth:`!copy` 以及 "
4394+
":meth:`!update` 等方法,它们的行为应与 Python 的标准 :class:`字典 <dict>` 对象的类似。 "
4395+
":mod:`collections.abc` 模块提供了一个 :class:`~collections.abc.MutableMapping` "
4396+
":term:`abstract base class` 以根据由 :meth:`~object.__getitem__`, "
4397+
":meth:`~object.__setitem__`, :meth:`~object.__delitem__` 和 :meth:`!keys` "
4398+
"组成的基本集来创建这些方法。 可变序列应当提供 :meth:`!append`, :meth:`!count`, :meth:`!index`, "
4399+
":meth:`!extend`, :meth:`!insert`, :meth:`!pop`, :meth:`!remove`, "
4400+
":meth:`!reverse` 和 :meth:`!sort` 等方法,就像 Python 标准 :class:`list` 对象那样。 "
4401+
"最后,序列类型还应当通过定义下文描述的 :meth:`~object.__add__`, :meth:`~object.__radd__`, "
4402+
":meth:`~object.__iadd__`, :meth:`~object.__mul__`, :meth:`~object.__rmul__` "
4403+
"和 :meth:`~object.__imul__` 等方法来实现加法(即拼接)和乘法(即重复);它们不应定义其他数值运算符。 "
4404+
"此外还建议映射和序列都实现 :meth:`~object.__contains__` 方法以允许高效地使用 ``in`` 运算符;对于映射,``in``"
4405+
" 应当搜索映射的键;对于序列,则应当搜索其中的值。 另外还建议映射和序列都实现 :meth:`~object.__iter__` "
4406+
&quo 4761 t;方法以允许高效地迭代容器;对于映射,:meth:`!__iter__` 应当迭代对象的键;对于序列,则应当迭代其中的值。"
43684407

43694408
#: ../../reference/datamodel.rst:3108
43704409
msgid ""

0 commit comments

Comments
 (0)
0