Skip to content

Commit 043bbdb

Browse files
[po] auto sync
1 parent b4dbdc7 commit 043bbdb

File tree

5 files changed

+118
-128
lines changed

5 files changed

+118
-128
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "94.46%", "updated_at": "2024-05-14T15:47:12Z"}
1+
{"translation": "94.45%", "updated_at": "2024-05-17T15:48:22Z"}

library/dataclasses.po

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-05-11 19:07+0000\n"
14+
"POT-Creation-Date: 2024-05-17 14:44+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:33+0000\n"
1616
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -833,16 +833,15 @@ msgstr ""
833833
msgid ""
834834
"There is a tiny performance penalty when using ``frozen=True``: "
835835
":meth:`~object.__init__` cannot use simple assignment to initialize fields, "
836-
"and must use :meth:`!__setattr__`."
836+
"and must use :meth:`!object.__setattr__`. .. Make sure to not remove "
837+
"\"object\" from \"object.__setattr__\" in the above markup"
837838
msgstr ""
838-
"在使用 ``frozen=True`` 时会有微小的性能损失: :meth:`~object.__init__` "
839-
"不能使用简单赋值来初始化字段,而必须使用 :meth:`!__setattr__`。"
840839

841-
#: ../../library/dataclasses.rst:621
840+
#: ../../library/dataclasses.rst:622
842841
msgid "Inheritance"
843842
msgstr "继承"
844843

845-
#: ../../library/dataclasses.rst:623
844+
#: ../../library/dataclasses.rst:624
846845
msgid ""
847846
"When the dataclass is being created by the :func:`@dataclass <dataclass>` "
848847
"decorator, it looks through all of the class's base classes in reverse MRO "
@@ -857,7 +856,7 @@ msgstr ""
857856
":class:`object` 开始)查看它的所有基类,并将找到的每个数据类的字段添加到一个有序映射中。 所有生成的方法都将使用这个有序映射。 "
858857
"字段会遵守它们被插入的顺序,因此派生类会重写基类。 一个例子::"
859858

860-
#: ../../library/dataclasses.rst:643
859+
#: ../../library/dataclasses.rst:644
861860
msgid ""
862861
"The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. "
863862
"The final type of :attr:`!x` is :class:`int`, as specified in class "
@@ -866,17 +865,17 @@ msgstr ""
866865
"最终的字段列表依次是 :attr:`!x`, :attr:`!y`, :attr:`!z`。 最终的 :attr:`!x` 类型是 "
867866
":class:`int`,正如类 :class:`!C` 中所指定的。"
868867

869-
#: ../../library/dataclasses.rst:646
868+
#: ../../library/dataclasses.rst:647
870869
msgid ""
871870
"The generated :meth:`~object.__init__` method for :class:`!C` will look "
872871
"like::"
873872
msgstr "为 :class:`!C` 生成的 :meth:`~object.__init__` 方法看起来像是这样::"
874873

875-
#: ../../library/dataclasses.rst:651
874+
#: ../../library/dataclasses.rst:652
876875
msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`"
877876
msgstr ":meth:`!__init__` 中仅限关键字形参的重新排序"
878877

879-
#: ../../library/dataclasses.rst:653
878+
#: ../../library/dataclasses.rst:654
880879
msgid ""
881880
"After the parameters needed for :meth:`~object.__init__` are computed, any "
882881
"keyword-only parameters are moved to come after all regular (non-keyword-"
@@ -886,7 +885,7 @@ msgstr ""
886885
"在计算出 :meth:`~object.__init__` 所需要的形参之后,任何仅限关键字形参会被移至所有常规(非仅限关键字)形参的后面。 这是 "
887886
"Python 中实现仅限关键字形参所要求的:它们必须位于非仅限关键字形参之后。"
888887

889-
#: ../../library/dataclasses.rst:659
888+
#: ../../library/dataclasses.rst:660
890889
msgid ""
891890
"In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are "
892891
"keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular "
@@ -895,29 +894,29 @@ msgstr ""
895894
"在这个例子中,:attr:`!Base.y`, :attr:`!Base.w` 和 :attr:`!D.t` 是仅限关键字字段,而 "
896895
":attr:`!Base.x` 和 :attr:`!D.z` 是常规字段::"
897896

898-
#: ../../library/dataclasses.rst:674
897+
#: ../../library/dataclasses.rst:675
899898
msgid ""
900899
"The generated :meth:`!__init__` method for :class:`!D` will look like::"
901900
msgstr "为 :class:`!D` 生成的 :meth:`!__init__` 方法看起来像是这样::"
902901

903-
#: ../../library/dataclasses.rst:678
902+
#: ../../library/dataclasses.rst:679
904903
msgid ""
905904
"Note that the parameters have been re-ordered from how they appear in the "
906905
"list of fields: parameters derived from regular fields are followed by "
907906
"parameters derived from keyword-only fields."
908907
msgstr "请注意形参原来在字段列表中出现的位置已被重新排序:前面是来自常规字段的形参而后面是来自仅限关键字字段的形参。"
909908

910-
#: ../../library/dataclasses.rst:682
909+
#: ../../library/dataclasses.rst:683
911910
msgid ""
912911
"The relative ordering of keyword-only parameters is maintained in the re-"
913912
"ordered :meth:`!__init__` parameter list."
914913
msgstr "仅限关键字形参的相对顺序会在重新排序的 :meth:`!__init__` 列表中保持不变。"
915914

916-
#: ../../library/dataclasses.rst:687
915+
#: ../../library/dataclasses.rst:688
917916
msgid "Default factory functions"
918917
msgstr "默认工厂函数"
919918

920-
#: ../../library/dataclasses.rst:689
919+
#: ../../library/dataclasses.rst:690
921920
msgid ""
922921
"If a :func:`field` specifies a *default_factory*, it is called with zero "
923922
"arguments when a default value for the field is needed. For example, to "
@@ -926,7 +925,7 @@ msgstr ""
926925
"如果一个 :func:`field` 指定了 *default_factory*,它将在该字段需要默认值时不带参数地被调用。 "
927926
"例如,要创建一个列表的新实例,则使用::"
928927

929-
#: ../../library/dataclasses.rst:695
928+
#: ../../library/dataclasses.rst:696
930929
msgid ""
931930
"If a field is excluded from :meth:`~object.__init__` (using ``init=False``) "
932931
"and the field also specifies *default_factory*, then the default factory "
@@ -938,31 +937,31 @@ msgstr ""
938937
"*default_factory*,则默认的工厂函数将总是会从生成的 :meth:`!__init__` 函数中被调用。 "
939938
"发生这种情况是因为没有其他方式能为字段提供初始值。"
940939

941-
#: ../../library/dataclasses.rst:702
940+
#: ../../library/dataclasses.rst:703
942941
msgid "Mutable default values"
943942
msgstr "可变的默认值"
944943

945-
#: ../../library/dataclasses.rst:704
944+
#: ../../library/dataclasses.rst:705
946945
msgid ""
947946
"Python stores default member variable values in class attributes. Consider "
948947
"this example, not using dataclasses::"
949948
msgstr "Python 在类属性中存储默认成员变量值。思考这个例子,不使用数据类::"
950949

951-
#: ../../library/dataclasses.rst:719
950+
#: ../../library/dataclasses.rst:720
952951
msgid ""
953952
"Note that the two instances of class :class:`!C` share the same class "
954953
"variable :attr:`!x`, as expected."
955954
msgstr "请注意类 :class:`!C` 的两个实例将共享同一个类变量 :attr:`!x`,正如预期的那样。"
956955

957-
#: ../../library/dataclasses.rst:722
956+
#: ../../library/dataclasses.rst:723
958957
msgid "Using dataclasses, *if* this code was valid::"
959958
msgstr "使用数据类,*如果* 此代码有效:"
960959

961-
#: ../../library/dataclasses.rst:730
960+
#: ../../library/dataclasses.rst:731
962961
msgid "it would generate code similar to::"
963962
msgstr "它生成的代码类似于::"
964963

965-
#: ../../library/dataclasses.rst:741
964+
#: ../../library/dataclasses.rst:742
966965
msgid ""
967966
"This has the same issue as the original example using class :class:`!C`. "
968967
"That is, two instances of class :class:`!D` that do not specify a value for "
@@ -980,13 +979,13 @@ msgstr ""
980979
"数据类没有任何通用方式来检测这种情况。 相反地,:func:`@dataclass <dataclass>` 装饰器在检测到不可哈希的默认形参时将会引发"
981980
" :exc:`ValueError`。 这一行为假定如果一个值是不可哈希的,则它就是可变对象。 这是一个部分解决方案,但它确实能防止许多常见错误。"
982981

983-
#: ../../library/dataclasses.rst:752
982+
#: ../../library/dataclasses.rst:753
984983
msgid ""
985984
"Using default factory functions is a way to create new instances of mutable "
986985
"types as default values for fields::"
987986
msgstr "使用默认工厂函数是一种创建可变类型新实例的方法,并将其作为字段的默认值::"
988987

989-
#: ../../library/dataclasses.rst:761
988+
#: ../../library/dataclasses.rst:762
990989
msgid ""
991990
"Instead of looking for and disallowing objects of type :class:`list`, "
992991
":class:`dict`, or :class:`set`, unhashable objects are now not allowed as "
@@ -995,17 +994,17 @@ msgstr ""
995994
"现在不再是寻找并阻止使用类型为 :class:`list`, :class:`dict` 或 :class:`set` "
996995
"的对象,而是不允许将不可哈希的对象用作默认值。 就是不可哈希性被作为不可变性的近似物了。"
997996

998-
#: ../../library/dataclasses.rst:768
997+
#: ../../library/dataclasses.rst:769
999998
msgid "Descriptor-typed fields"
1000999
msgstr "描述器类型的字段"
10011000

1002-
#: ../../library/dataclasses.rst:770
1001+
#: ../../library/dataclasses.rst:771
10031002
msgid ""
10041003
"Fields that are assigned :ref:`descriptor objects <descriptors>` as their "
10051004
"default value have the following special behaviors:"
10061005
msgstr "当字段被 :ref:`描述器对象 <descriptors>` 赋值为默认值时会遵循以下行为:"
10071006

1008-
#: ../../library/dataclasses.rst:773
1007+
#: ../../library/dataclasses.rst:774
10091008
msgid ""
10101009
"The value for the field passed to the dataclass's :meth:`~object.__init__` "
10111010
"method is passed to the descriptor's :meth:`~object.__set__` method rather "
@@ -1014,7 +1013,7 @@ msgstr ""
10141013
"传递给数据类的 :meth:`~object.__init__` 方法的字段值会被传递给描述器的 :meth:`~object.__set__` "
10151014
"方法而不会覆盖描述器对象。"
10161015

1017-
#: ../../library/dataclasses.rst:777
1016+
#: ../../library/dataclasses.rst:778
10181017
msgid ""
10191018
"Similarly, when getting or setting the field, the descriptor's "
10201019
":meth:`~object.__get__` or :meth:`!__set__` method is called rather than "
@@ -1023,7 +1022,7 @@ msgstr ""
10231022
"类似地,当获取或设置字段值时,将调用描述器的 :meth:`~object.__get__` 或 :meth:`!__set__` "
10241023
"方法而不是返回或重写描述器对象。"
10251024

1026-
#: ../../library/dataclasses.rst:781
1025+
#: ../../library/dataclasses.rst:782
10271026
msgid ""
10281027
"To determine whether a field contains a default value, :func:`@dataclass "
10291028
"<dataclass>` will call the descriptor's :meth:`!__get__` method using its "
@@ -1037,7 +1036,7 @@ msgstr ""
10371036
"如果在此情况下描述器返回了一个值,它将被用作字段的默认值。 另一方面,如果在此情况下描述器引发了 "
10381037
":exc:`AttributeError`,则不会为字段提供默认值。"
10391038

1040-
#: ../../library/dataclasses.rst:816
1039+
#: ../../library/dataclasses.rst:817
10411040
msgid ""
10421041
"Note that if a field is annotated with a descriptor type, but is not "
10431042
"assigned a descriptor object as its default value, the field will act like a"

library/functools.po

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.12\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-05-11 19:07+0000\n"
14+
"POT-Creation-Date: 2024-05-17 14:44+0000\n"
1515
"PO-Revision-Date: 2024-05-11 00:33+0000\n"
1616
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n"
1717
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -637,17 +637,12 @@ msgid ""
637637
"corresponding attributes from the original function. The default values for "
638638
"these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` "
639639
"(which assigns to the wrapper function's ``__module__``, ``__name__``, "
640-
"``__qualname__``, ``__annotations__`` and ``__doc__``, the documentation "
641-
"string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's "
642-
"``__dict__``, i.e. the instance dictionary)."
640+
"``__qualname__``, ``__annotations__``, ``__type_params__``, and ``__doc__``,"
641+
" the documentation string) and ``WRAPPER_UPDATES`` (which updates the "
642+
"wrapper function's ``__dict__``, i.e. the instance dictionary)."
643643
msgstr ""
644-
"更新一个 *wrapper* 函数以使其类似于 *wrapped* 函数。 可选参数为指明原函数的哪些属性要直接被赋值给 wrapper "
645-
"函数的匹配属性的元组,并且这些 wrapper 函数的属性将使用原函数的对应属性来更新。 这些参数的默认值是模块级常量 "
646-
"``WRAPPER_ASSIGNMENTS`` (它将被赋值给 wrapper 函数的 ``__module__``, ``__name__``, "
647-
"``__qualname__``, ``__annotations__`` 和 ``__doc__`` 即文档字符串) 以及 "
648-
"``WRAPPER_UPDATES`` (它将更新 wrapper 函数的 ``__dict__`` 即实例字典)。"
649644

650-
#: ../../library/functools.rst:651
645+
#: ../../library/functools.rst:652
651646
msgid ""
652647
"To allow access to the original function for introspection and other "
653648
"purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), "
@@ -657,7 +652,7 @@ msgstr ""
657652
"为了允许出于内省和其他目的访问原始函数(例如绕过 :func:`lru_cache` 之类的缓存装饰器),此函数会自动为 wrapper "
658653
"添加一个指向被包装函数的 ``__wrapped__`` 属性。"
659654

660-
#: ../../library/functools.rst:656
655+
#: ../../library/functools.rst:657
661656
msgid ""
662657
"The main intended use for this function is in :term:`decorator` functions "
663658
"which wrap the decorated function and return the wrapper. If the wrapper "
@@ -668,7 +663,7 @@ msgstr ""
668663
"此函数的主要目的是在 :term:`decorator` 函数中用来包装被装饰的函数并返回包装器。 "
669664
"如果包装器函数未被更新,则被返回函数的元数据将反映包装器定义而不是原始函数定义,这通常没有什么用处。"
670665

671-
#: ../../library/functools.rst:662
666+
#: ../../library/functools.rst:663
672667
msgid ""
673668
":func:`update_wrapper` may be used with callables other than functions. Any "
674669
"attributes named in *assigned* or *updated* that are missing from the object"
@@ -680,7 +675,7 @@ msgstr ""
680675
"中命名的任何属性如果不存在于被包装对象则会被忽略(即该函数将不会尝试在包装器函数上设置它们)。 如果包装器函数自身缺少在 *updated* "
681676
"中命名的任何属性则仍将引发 :exc:`AttributeError`。"
682677

683-
#: ../../library/functools.rst:668
678+
#: ../../library/functools.rst:669
684679
msgid ""
685680
"The ``__wrapped__`` attribute is now automatically added. The "
686681
"``__annotations__`` attribute is now copied by default. Missing attributes "
@@ -689,7 +684,7 @@ msgstr ""
689684
"现在 ``__wrapped__`` 属性会被自动添加。 现在 ``__annotations__`` 属性默认将被拷贝。 缺失的属性将不再触发 "
690685
":exc:`AttributeError`。"
691686

692-
#: ../../library/functools.rst:673
687+
#: ../../library/functools.rst:674
693688
msgid ""
694689
"The ``__wrapped__`` attribute now always refers to the wrapped function, "
695690
"even if that function defined a ``__wrapped__`` attribute. (see "
@@ -698,7 +693,11 @@ msgstr ""
698693
"``__wrapped__`` 属性现在总是指向被包装的函数,即使该函数定义了 ``__wrapped__`` 属性。 (参见 "
699694
":issue:`17482`)"
700695

701-
#: ../../library/functools.rst:681
696+
#: ../../library/functools.rst:679
697+
msgid "The ``__type_params__`` attribute is now copied by default."
698+
msgstr ""
699+
700+
#: ../../library/functools.rst:685
702701
msgid ""
703702
"This is a convenience function for invoking :func:`update_wrapper` as a "
704703
"function decorator when defining a wrapper function. It is equivalent to "
@@ -709,7 +708,7 @@ msgstr ""
709708
"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
710709
"updated=updated)``。 例如::"
711710

712-
#: ../../library/functools.rst:707
711+
#: ../../library/functools.rst:711
713712
msgid ""
714713
"Without the use of this decorator factory, the name of the example function "
715714
"would have been ``'wrapper'``, and the docstring of the original "
@@ -718,35 +717,35 @@ msgstr ""
718717
"如果不使用这个装饰器工厂函数,则 example 函数的名称将变为 ``'wrapper'``,并且 :func:`example` "
719718
"原本的文档字符串将会丢失。"
720719

721-
#: ../../library/functools.rst:715
720+
#: ../../library/functools.rst:719
722721
msgid ":class:`partial` Objects"
723722
msgstr ":class:`partial` 对象"
724723

725-
#: ../../library/functools.rst:717
724+
#: ../../library/functools.rst:721
726725
msgid ""
727726
":class:`partial` objects are callable objects created by :func:`partial`. "
728727
"They have three read-only attributes:"
729728
msgstr ":class:`partial` 对象是由 :func:`partial` 创建的可调用对象。 它们具有三个只读属性:"
730729

731-
#: ../../library/functools.rst:723
730+
#: ../../library/functools.rst:727
732731
msgid ""
733732
"A callable object or function. Calls to the :class:`partial` object will be"
734733
" forwarded to :attr:`func` with new arguments and keywords."
735734
msgstr "一个可调用对象或函数。 对 :class:`partial` 对象的调用将被转发给 :attr:`func` 并附带新的参数和关键字。"
736735

737-
#: ../../library/functools.rst:729
736+
#: ../../library/functools.rst:733
738737
msgid ""
739738
"The leftmost positional arguments that will be prepended to the positional "
740739
"arguments provided to a :class:`partial` object call."
741740
msgstr "最左边的位置参数将放置在提供给 :class:`partial` 对象调用的位置参数之前。"
742741

743-
#: ../../library/functools.rst:735
742+
#: ../../library/functools.rst:739
744743
msgid ""
745744
"The keyword arguments that will be supplied when the :class:`partial` object"
746745
" is called."
747746
msgstr "当调用 :class:`partial` 对象时将要提供的关键字参数。"
748747

749-
#: ../../library/functools.rst:738
748+
#: ../../library/functools.rst:742
750749
msgid ""
751750
":class:`partial` objects are like :class:`function` objects in that they are"
752751
" callable, weak referenceable, and can have attributes. There are some "

0 commit comments

Comments
 (0)