@@ -2978,6 +2978,14 @@ msgid ""
2978
2978
"changes in the class hierarchy, and because that order can include sibling "
2979
2979
"classes that are unknown prior to runtime)."
2980
2980
msgstr ""
2981
+ "2つ目の用途は動的な実行環境において協調的 (cooperative) な多重継承をサポート"
2982
+ "することです。これは Python に特有の用途で、静的にコンパイルされる言語や、単"
2983
+ "継承のみをサポートする言語には見られないものです。この機能により、同じ名前の"
2984
+ "メソッドを実装する複数の基底クラスを使った \" ダイヤモンド型* の継承構造を実装"
2985
+ "することができます。良い設計は、そのような実装において、どのような場合でも同"
2986
+ "じ呼び出しシグネチャを持つように強制します。 (理由は呼び出しの順序が実行時に"
2987
+ "決定されること、呼び出し順序はクラス階層構造の変化に順応すること、そして呼び"
2988
+ "出し順序が実行時まで未知の兄弟クラスが含まれる場合があることです)。"
2981
2989
2982
2990
#: ../../library/functions.rst:1653
2983
2991
msgid "For both use cases, a typical superclass call looks like this::"
@@ -2990,6 +2998,9 @@ msgid ""
2990
2998
"lookups. One possible use case for this is calling :term:`descriptors "
2991
2999
"<descriptor>` in a parent or sibling class."
2992
3000
msgstr ""
3001
+ "メソッドのルックアップに加えて、 :func:`super` は属性のルックアップに対しても"
3002
+ "同様に動作します。考えうる用途のひとつは親クラスや兄弟クラスの :term:"
3003
+ "`descriptors <descriptor>` (デスクリプタ) を呼び出すことです。"
2993
3004
2994
3005
#: ../../library/functions.rst:1664
2995
3006
msgid ""
@@ -3070,6 +3081,14 @@ msgid ""
3070
3081
"the :attr:`~object.__dict__` attribute. The following two statements create "
3071
3082
"identical :class:`type` objects:"
3072
3083
msgstr ""
3084
+ "引数が3つの場合、新しい型オブジェクトを返します。これは本質的には :keyword:"
3085
+ "`class` 文の動的な書式です。 *name* 文字列はクラス名で、 :attr:`~definition."
3086
+ "__name__` 属性になります。 *bases* 基底クラスのタプルで、 :attr:`~class."
3087
+ "__bases__` 属性になります; 空の場合は全てのクラスの基底クラスである :class:"
3088
+ "`object` が追加されます。 *dict* は、クラス本体の属性とメソッドの定義を含む辞"
3089
+ "書です; 辞書は :attr:`~object.__dict__` 属性になる前にコピーされたり、ラップ"
3090
+ "されることがあります。以下の2つの文は同じ :class:`type` オブジェクトを生成し"
3091
+ "ます:"
3073
3092
3074
3093
#: ../../library/functions.rst:1719
3075
3094
msgid "See also :ref:`bltin-type-objects`."
@@ -3082,6 +3101,9 @@ msgid ""
3082
3101
"in the same way that keywords in a class definition (besides *metaclass*) "
3083
3102
"would."
3084
3103
msgstr ""
3104
+ "三引数形式の呼び出しに与えられたキーワード引数は、(*metaclass* を除く) クラス"
3105
+ "定義におけるキーワード引数と同様に、適切なメタクラスの機構 (通常は :meth:"
3106
+ "`~object.__init_subclass__`) に渡されます。"
3085
3107
3086
3108
#: ../../library/functions.rst:1726
3087
3109
msgid "See also :ref:`class-customization`."
@@ -3133,6 +3155,9 @@ msgid ""
3133
3155
"doesn't have a :attr:`~object.__dict__` attribute (for example, if its class "
3134
3156
"defines the :attr:`~object.__slots__` attribute)."
3135
3157
msgstr ""
3158
+ "指定されたオブジェクトに :attr:`~object.__dict__` 属性がない場合 (たとえばそ"
3159
+ "のクラスが :attr:`~object.__slots__` 属性を定義している場合)、 :exc:"
3160
+ "`TypeError` 例外が送出されます。"
3136
3161
3137
3162
#: ../../library/functions.rst:1752
3138
3163
msgid "Make an iterator that aggregates elements from each of the iterables."
0 commit comments