@@ -2765,31 +2765,34 @@ msgid ""
27652765"ultimately calls ``type.__new__``, the following additional customisation "
27662766"steps are invoked after creating the class object:"
27672767msgstr ""
2768+ "当使用默认的元类 :class:`type` 或者任何最终会调用 ``type.__new__`` "
2769+ "的元类时,以下额外的自定义步骤将在创建类对象之后被发起调用:"
27682770
27692771#: ../../reference/datamodel.rst:1980
27702772msgid ""
27712773"first, ``type.__new__`` collects all of the descriptors in the class "
27722774"namespace that define a :meth:`~object.__set_name__` method;"
27732775msgstr ""
2776+ "首先,``type.__new__`` 将收集类命名空间中所有定义了 :meth:`~object.__set_name__` 方法的描述器;"
27742777
27752778#: ../../reference/datamodel.rst:1982
27762779msgid ""
27772780"second, all of these ``__set_name__`` methods are called with the class "
27782781"being defined and the assigned name of that particular descriptor; and"
2779- msgstr ""
2782+ msgstr "接下来,所有这些 ``__set_name__`` 方法将使用所定义的类和特定描述器所赋的名称进行调用; "
27802783
27812784#: ../../reference/datamodel.rst:1984
27822785msgid ""
27832786"finally, the :meth:`~object.__init_subclass__` hook is called on the "
27842787"immediate parent of the new class in its method resolution order."
2785- msgstr ""
2788+ msgstr "最后,将在新类根据方法解析顺序所确定的直接父类上调用 :meth:`~object.__init_subclass__` 钩子。 "
27862789
27872790#: ../../reference/datamodel.rst:1987
27882791msgid ""
27892792"After the class object is created, it is passed to the class decorators "
27902793"included in the class definition (if any) and the resulting object is bound "
27912794"in the local namespace as the defined class."
2792- msgstr ""
2795+ msgstr "在类对象创建之后,它会被传给包含在类定义中的类装饰器(如果有的话),得到的对象将作为已定义的类绑定到局部命名空间。 "
27932796
27942797#: ../../reference/datamodel.rst:1991
27952798msgid ""
@@ -2798,26 +2801,29 @@ msgid ""
27982801"object is discarded. The new copy is wrapped in a read-only proxy, which "
27992802"becomes the :attr:`~object.__dict__` attribute of the class object."
28002803msgstr ""
2804+ "当通过 ``type.__new__`` "
2805+ "创建一个新类时,提供以作为命名空间形参的对象会被复制到一个新的有序映射并丢弃原对象。这个新副本包装于一个只读代理中,后者则成为类对象的 "
2806+ ":attr:`~object.__dict__` 属性。"
28012807
28022808#: ../../reference/datamodel.rst:1998
28032809msgid ":pep:`3135` - New super"
2804- msgstr ""
2810+ msgstr ":pep:`3135` - 新的超类型 "
28052811
28062812#: ../../reference/datamodel.rst:1999
28072813msgid "Describes the implicit ``__class__`` closure reference"
2808- msgstr ""
2814+ msgstr "描述隐式的 ``__class__`` 闭包引用 "
28092815
28102816#: ../../reference/datamodel.rst:2003
28112817msgid "Uses for metaclasses"
2812- msgstr ""
2818+ msgstr "元类的作用 "
28132819
28142820#: ../../reference/datamodel.rst:2005
28152821msgid ""
28162822"The potential uses for metaclasses are boundless. Some ideas that have been "
28172823"explored include enum, logging, interface checking, automatic delegation, "
28182824"automatic property creation, proxies, frameworks, and automatic resource "
28192825"locking/synchronization."
2820- msgstr ""
2826+ msgstr "元类的潜在作用非常广泛。已经过尝试的设想包括枚举、日志、接口检查、自动委托、自动特征属性创建、代理、框架以及自动资源锁定/同步等等。 "
28212827
28222828#: ../../reference/datamodel.rst:2012
28232829msgid "Customizing instance and subclass checks"
0 commit comments