@@ -59,6 +59,15 @@ msgid ""
5959" below.) The last version of the constructor expects a string or unicode "
6060"instance. The usual form for this instance is::"
6161msgstr ""
62+ "第一个版本要求 *numerator* 和 *denominator* 是 :class:`numbers.Rational` 的实例,并返回一个新的 "
63+ ":class:`Fraction` 实例,其值为 ``numerator/denominator``。 如果 *denominator* 为 "
64+ ":const:`0` 将会引发 :exc:`ZeroDivisionError`。 第二个版本要求 *other_fraction* 是 "
65+ ":class:`numbers.Rational` 的实例,并返回一个 :class:`Fraction` 实例且与传入值相等。 下两个版本接受 "
66+ ":class:`float` 或 :class:`decimal.Decimal` 的实例,并返回一个 :class:`Fraction` "
67+ "实例且与传入值完全相等。 请注意由于二进制浮点数通常存在的问题 (参见 :ref:`tut-fp-issues`),``Fraction(1.1)`` "
68+ "的参数并不会精确等于 11/10,因此 ``Fraction(1.1)`` 也 *不会* 返回用户所期望的 ``Fraction(11, 10)``。 "
69+ "(请参阅下文中 :meth:`limit_denominator` 方法的文档。) 构造器的最后一个版本接受一个字符串或 unicode 实例。 "
70+ "此实例的通常形式为::"
6271
6372#: ../../library/fractions.rst:43
6473msgid ""
@@ -69,6 +78,9 @@ msgid ""
6978"constructor. In either form the input string may also have leading and/or "
7079"trailing whitespace. Here are some examples::"
7180msgstr ""
81+ "其中的可选项 ``sign`` 可以为 '+' 或 '-' 并且 ``numerator`` 和 ``denominator`` (如果存在) "
82+ "是十进制数码的字符串。 此外,:class:`float` 构造器所接受的任何表示一个有限值的字符串也都为 :class:`Fraction` "
83+ "构造器所接受。 不论哪种形式的输入字符串也都可以带有前缀和/或后缀的空格符。 这里是一些示例::"
7284
7385#: ../../library/fractions.rst:77
7486msgid ""
@@ -78,6 +90,8 @@ msgid ""
7890"treated as immutable. In addition, :class:`Fraction` has the following "
7991"properties and methods:"
8092msgstr ""
93+ ":class:`Fraction` 类继承自抽象基类 :class:`numbers.Rational`,并实现了该类的所有方法和操作。 "
94+ ":class:`Fraction` 实例是可哈希的,并应当被视为不可变对象。 此外,:class:`Fraction` 还具有以下属性和方法:"
8195
8296#: ../../library/fractions.rst:83
8397msgid ""
@@ -100,24 +114,29 @@ msgid ""
100114"value of *flt*, which must be a :class:`float`. Beware that "
101115"``Fraction.from_float(0.3)`` is not the same value as ``Fraction(3, 10)``."
102116msgstr ""
117+ "此类方法可构造一个 :class:`Fraction` 来表示 *flt* 的精确值,该参数必须是一个 :class:`float`。 请注意 "
118+ "``Fraction.from_float(0.3)`` 的值并不等于 ``Fraction(3, 10)``。"
103119
104120#: ../../library/fractions.rst:105
105121msgid ""
106122"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance"
107123" directly from a :class:`float`."
108- msgstr ""
124+ msgstr "从 Python 3.2 开始,在构造 :class:`Fraction` 实例时可以直接使用 :class:`float`。 "
109125
110126#: ../../library/fractions.rst:111
111127msgid ""
112128"This class method constructs a :class:`Fraction` representing the exact "
113129"value of *dec*, which must be a :class:`decimal.Decimal` instance."
114130msgstr ""
131+ "此类方法可构造一个 :class:`Fraction` 来表示 *dec* 的精确值,该参数必须是一个 :class:`decimal.Decimal`"
132+ " 实例。"
115133
116134#: ../../library/fractions.rst:116
117135msgid ""
118136"From Python 3.2 onwards, you can also construct a :class:`Fraction` instance"
119137" directly from a :class:`decimal.Decimal` instance."
120138msgstr ""
139+ "从 Python 3.2 开始,在构造 :class:`Fraction` 实例时可以直接使用 :class:`decimal.Decimal` 实例。"
121140
122141#: ../../library/fractions.rst:123
123142msgid ""
0 commit comments