@@ -91,7 +91,7 @@ msgstr "此 Enum 类装饰器可确保只将一个名称绑定到任意一个值
9191msgid ""
9292"Instances are replaced with an appropriate value for Enum members. By "
9393"default, the initial value starts at 1."
94- msgstr ""
94+ msgstr "实例会被替换为一个可作为 Enum 成员的适当的值。 默认情况下,初始值从 1 开始。 "
9595
9696#: ../../library/enum.rst:60
9797msgid "``Flag``, ``IntFlag``, ``auto``"
@@ -368,6 +368,8 @@ msgid ""
368368"then any value(s) given to the enum member will be passed into those "
369369"methods. See `Planet`_ for an example."
370370msgstr ""
371+ "注意:如果你的枚举定义了 :meth:`__new__` 和/或 :meth:`__init__` 那么给予枚举成员的任何值都会被传入这些方法。 "
372+ "请参阅示例 `Planet`_。"
371373
372374#: ../../library/enum.rst:395
373375msgid "Restricted Enum subclassing"
@@ -732,6 +734,8 @@ msgid ""
732734":class:`int` above. This restriction does not apply to mix-ins which only "
733735"add methods and don't specify another type."
734736msgstr ""
737+ "虽然 :class:`Enum` 可以拥有任意类型的成员,不过一旦你混合了附加类型,则所有成员必须为相应类型的值,如在上面的例子中即为 "
738+ ":class:`int`。 此限制不适用于仅添加方法而未指定另一数据类型的混合类。"
735739
736740#: ../../library/enum.rst:738
737741msgid ""
@@ -758,6 +762,10 @@ msgid ""
758762" the !s and !r format codes to force usage of the :class:`Enum` class's "
759763":meth:`__str__` and :meth:`__repr__` methods."
760764msgstr ""
765+ ":ref:`格式化字符串字面值 <f-strings>`, :meth:`str.format` 和 :func:`format` 将使用混合类型的 "
766+ ":meth:`__format__` 除非在子类中重载了 :meth:`__str__` 或 "
767+ ":meth:`__format__`,在这种情况下将使用被重载的方法或 :class:`Enum` 的方法。 请使用 !s 和 !r 格式代码来强制使用"
768+ " :class:`Enum` 类的 :meth:`__str__` 和 :meth:`__repr__` 方法。"
761769
762770#: ../../library/enum.rst:752
763771msgid "When to use :meth:`__new__` vs. :meth:`__init__`"
@@ -1016,6 +1024,7 @@ msgid ""
10161024":class:`str`, that will not be transformed into members, and will be removed"
10171025" from the final class"
10181026msgstr ""
1027+ "``_ignore_`` -- 一个名称列表,可以为 :class:`list` 或 :class:`str`,它不会被转化为成员,并将从最终类中被移除"
10191028
10201029#: ../../library/enum.rst:1063
10211030msgid ""
0 commit comments