@@ -1660,13 +1660,17 @@ msgid ""
1660
1660
":func:`annotationlib.get_annotations` instead of accessing this attribute "
1661
1661
"directly."
1662
1662
msgstr ""
1663
+ "有关使用 :attr:`~object.__annotations__` 的最佳实践,请参阅 :mod:`annotationlib`。 "
1664
+ "如有可能,请使用 :func:`annotationlib.get_annotations` 而不是直接访问该属性。"
1663
1665
1664
1666
#: ../../reference/datamodel.rst:1240
1665
1667
msgid ""
1666
1668
"The :term:`annotate function` for this class, or ``None`` if the class has "
1667
1669
"no annotations. See also: :attr:`__annotate__ attributes "
1668
1670
"<object.__annotate__>`."
1669
1671
msgstr ""
1672
+ "针对该类的 :term:`annotate function`,或者如果类没有标注则为 ``None``。 另请参阅: "
1673
+ ":attr:`__annotate__ 属性 <object.__annotate__>`。"
1670
1674
1671
1675
#: ../../reference/datamodel.rst:1247
1672
1676
msgid ""
@@ -1996,6 +2000,9 @@ msgid ""
1996
2000
" and the first item in :attr:`~codeobject.co_consts` is the docstring of the"
1997
2001
" function."
1998
2002
msgstr ""
2003
+ "如果一个代码对象代表函数并且具有文档字符串,则会在 :attr:`~codeobject.co_flags` 中设置 "
2004
+ ":data:`~inspect.CO_HAS_DOCSTRING` 比特位并且 :attr:`~codeobject.co_consts` "
2005
+ "中的第一个条目将是该函数的文档字符串。"
1999
2006
2000
2007
#: ../../reference/datamodel.rst:1530
2001
2008
msgid "Methods on code objects"
@@ -4964,13 +4971,13 @@ msgstr ""
4964
4971
4965
4972
#: ../../reference/datamodel.rst:3586
4966
4973
msgid "Annotations are now lazily evaluated."
4967
- msgstr ""
4974
+ msgstr "标注现在将被惰性求值。 "
4968
4975
4969
4976
#: ../../reference/datamodel.rst:3591
4970
4977
msgid ""
4971
4978
"An :term:`annotate function`. Returns a new dictionary object mapping "
4972
4979
"attribute/parameter names to their annotation values."
4973
- msgstr ""
4980
+ msgstr "一个 :term:`annotate function`。 将返回一个将属性/形参名称映射到其标注值的新字典对象。 "
4974
4981
4975
4982
#: ../../reference/datamodel.rst:3594
4976
4983
msgid ""
@@ -5003,12 +5010,12 @@ msgstr ""
5003
5010
5004
5011
#: ../../reference/datamodel.rst:3613
5005
5012
msgid ":pep:`649` --- Deferred evaluation of annotation using descriptors"
5006
- msgstr ""
5013
+ msgstr ":pep:`649` --- 使用描述器进行延迟标注求值 "
5007
5014
5008
5015
#: ../../reference/datamodel.rst:3614
5009
5016
msgid ""
5010
5017
"Introduces lazy evaluation of annotations and the ``__annotate__`` function."
5011
- msgstr ""
5018
+ msgstr "引入标注的惰性求值以及 ``__annotate__`` 函数。 "
5012
5019
5013
5020
#: ../../reference/datamodel.rst:3620
5014
5021
msgid "Special method lookup"
@@ -5466,13 +5473,15 @@ msgid ""
5466
5473
"method (such as :meth:`~object.__add__`) fails then the operation is not "
5467
5474
"supported, which is why the reflected method is not called."
5468
5475
msgstr ""
5476
+ "对于相同类型的操作数,如果非反射方法 (如 :meth:`~object.__add__`) "
5477
+ "执行失败则相应的操作将被视为不受支持,这就是反射方法不会被调用的原因。"
5469
5478
5470
5479
#: ../../reference/datamodel.rst:3901
5471
5480
msgid ""
5472
5481
"If the right operand's type is a subclass of the left operand's type, the "
5473
5482
"reflected method having precedence allows subclasses to override their "
5474
5483
"ancestors' operations."
5475
- msgstr ""
5484
+ msgstr "如果右操作数的类型为左操作数的类型的子类,则具有优先地位的反射方法将允许子类重写其祖先类的操作。 "
5476
5485
5477
5486
#: ../../reference/datamodel.rst:14 ../../reference/datamodel.rst:152
5478
5487
#: ../../reference/datamodel.rst:163 ../../reference/datamodel.rst:187