@@ -13,7 +13,7 @@ msgid ""
1313msgstr ""
1414"Project-Id-Version : Python 3.9\n "
1515"Report-Msgid-Bugs-To : \n "
16- "POT-Creation-Date : 2021-05-07 06:17 +0000\n "
16+ "POT-Creation-Date : 2021-05-11 06:18 +0000\n "
1717"PO-Revision-Date : 2018-06-29 21:06+0000\n "
1818"Last-Translator : Takanori Suzuki <takanori@takanory.net>, 2021\n "
1919"Language-Team : Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n "
@@ -609,18 +609,33 @@ msgstr ""
609609
610610#: ../../library/dataclasses.rst:425
611611msgid ""
612+ "The :meth:`__init__` method generated by :func:`dataclass` does not call "
613+ "base class :meth:`__init__` methods. If the base class has an "
614+ ":meth:`__init__` method that has to be called, it is common to call this "
615+ "method in a :meth:`__post_init__` method::"
616+ msgstr ""
617+
618+ #: ../../library/dataclasses.rst:442
619+ msgid ""
620+ "Note, however, that in general the dataclass-generated :meth:`__init__` "
621+ "methods don't need to be called, since the derived dataclass will take care "
622+ "of initializing all fields of any base class that is a dataclass itself."
623+ msgstr ""
624+
625+ #: ../../library/dataclasses.rst:446
626+ msgid ""
612627"See the section below on init-only variables for ways to pass parameters to "
613628":meth:`__post_init__`. Also see the warning about how :func:`replace` "
614629"handles ``init=False`` fields."
615630msgstr ""
616631"下にある初期化限定変数についての節で、 :meth:`__post_init__` にパラメータを渡す方法を参照してください。\n"
617632":func:`replace` が ``init=False`` であるフィールドをどう取り扱うかについての警告も参照してください。"
618633
619- #: ../../library/dataclasses.rst:430
634+ #: ../../library/dataclasses.rst:451
620635msgid "Class variables"
621636msgstr "クラス変数"
622637
623- #: ../../library/dataclasses.rst:432
638+ #: ../../library/dataclasses.rst:453
624639msgid ""
625640"One of two places where :func:`dataclass` actually inspects the type of a "
626641"field is to determine if a field is a class variable as defined in "
@@ -635,11 +650,11 @@ msgstr ""
635650"フィールドが ``ClassVar`` の場合、フィールドとは見なされなくなり、データクラスの機構からは無視されます。\n"
636651"そのような ``ClassVar`` 疑似フィールドは、モジュールレベル関数 :func:`fields` の返り値には含まれません。"
637652
638- #: ../../library/dataclasses.rst:441
653+ #: ../../library/dataclasses.rst:462
639654msgid "Init-only variables"
640655msgstr "初期化限定変数"
641656
642- #: ../../library/dataclasses.rst:443
657+ #: ../../library/dataclasses.rst:464
643658msgid ""
644659"The other place where :func:`dataclass` inspects a type annotation is to "
645660"determine if a field is an init-only variable. It does this by seeing if "
@@ -657,25 +672,25 @@ msgstr ""
657672"初期化限定フィールドは生成された :meth:`__init__` メソッドに引数として追加され、オプションの :meth:`__post_init__` メソッドにも渡されます。\n"
658673"初期化限定フィールドは、データクラスからはそれ以外では使われません。"
659674
660- #: ../../library/dataclasses.rst:453
675+ #: ../../library/dataclasses.rst:474
661676msgid ""
662677"For example, suppose a field will be initialized from a database, if a value"
663678" is not provided when creating the class::"
664679msgstr "例えば、あるフィールドがデータベースから初期化されると仮定して、クラスを作成するときには値が与えられない次の場合を考えます::"
665680
666- #: ../../library/dataclasses.rst:468
681+ #: ../../library/dataclasses.rst:489
667682msgid ""
668683"In this case, :func:`fields` will return :class:`Field` objects for ``i`` "
669684"and ``j``, but not for ``database``."
670685msgstr ""
671686"このケースでは、 :func:`fields` は ``i`` と ``j`` の :class:`Field` オブジェクトは返しますが、 "
672687"``database`` の :class:`Field` オブジェクトは返しません。"
673688
674- #: ../../library/dataclasses.rst:472
689+ #: ../../library/dataclasses.rst:493
675690msgid "Frozen instances"
676691msgstr "凍結されたインスタンス"
677692
678- #: ../../library/dataclasses.rst:474
693+ #: ../../library/dataclasses.rst:495
679694msgid ""
680695"It is not possible to create truly immutable Python objects. However, by "
681696"passing ``frozen=True`` to the :meth:`dataclass` decorator you can emulate "
@@ -688,7 +703,7 @@ msgstr ""
688703"このケースでは、データクラスは :meth:`__setattr__` メソッドと :meth:`__delattr__` メソッドをクラスに追加します。\n"
689704"これらのメソッドは起動すると :exc:`FrozenInstanceError` を送出します。"
690705
691- #: ../../library/dataclasses.rst:480
706+ #: ../../library/dataclasses.rst:501
692707msgid ""
693708"There is a tiny performance penalty when using ``frozen=True``: "
694709":meth:`__init__` cannot use simple assignment to initialize fields, and must"
@@ -697,11 +712,11 @@ msgstr ""
697712"``frozen=True`` を使うとき、実行する上でのわずかな代償があります: :meth:`__init__` "
698713"でフィールドを初期化するのに単純に割り当てることはできず、 :meth:`object.__setattr__` を使わなくてはなりません。"
699714
700- #: ../../library/dataclasses.rst:485
715+ #: ../../library/dataclasses.rst:506
701716msgid "Inheritance"
702717msgstr "継承"
703718
704- #: ../../library/dataclasses.rst:487
719+ #: ../../library/dataclasses.rst:508
705720msgid ""
706721"When the dataclass is being created by the :meth:`dataclass` decorator, it "
707722"looks through all of the class's base classes in reverse MRO (that is, "
@@ -718,23 +733,23 @@ msgstr ""
718733"フィールドは挿入順序で並んでいるので、派生クラスは基底クラスをオーバーライドします。\n"
719734"例えば次のようになります::"
720735
721- #: ../../library/dataclasses.rst:507
736+ #: ../../library/dataclasses.rst:528
722737msgid ""
723738"The final list of fields is, in order, ``x``, ``y``, ``z``. The final type "
724739"of ``x`` is ``int``, as specified in class ``C``."
725740msgstr ""
726741"最終的に出来上がるフィールドのリストは ``x``, ``y``, ``z`` の順番になります。\n"
727742"最終的な ``x`` の型は、 クラス ``C`` で指定されている通り ``int`` です。"
728743
729- #: ../../library/dataclasses.rst:510
744+ #: ../../library/dataclasses.rst:531
730745msgid "The generated :meth:`__init__` method for ``C`` will look like::"
731746msgstr "``C`` の生成された :meth:`__init__` メソッドは次のようになります::"
732747
733- #: ../../library/dataclasses.rst:515
748+ #: ../../library/dataclasses.rst:536
734749msgid "Default factory functions"
735750msgstr "デフォルトファクトリ関数"
736751
737- #: ../../library/dataclasses.rst:517
752+ #: ../../library/dataclasses.rst:538
738753msgid ""
739754"If a :func:`field` specifies a ``default_factory``, it is called with zero "
740755"arguments when a default value for the field is needed. For example, to "
@@ -743,7 +758,7 @@ msgstr ""
743758":func:`field` に ``default_factory`` を指定した場合、そのフィールドのデフォルト値が必要とされたときに、引数無しで呼び出されます。\n"
744759"これは例えば、リストの新しいインスタンスを作成するために使います::"
745760
746- #: ../../library/dataclasses.rst:523
761+ #: ../../library/dataclasses.rst:544
747762msgid ""
748763"If a field is excluded from :meth:`__init__` (using ``init=False``) and the "
749764"field also specifies ``default_factory``, then the default factory function "
@@ -753,33 +768,33 @@ msgstr ""
753768"あるフィールドが (``init=False`` を使って) :meth:`__init__` から除外され、かつ、 ``default_factory`` が指定されていた場合、デフォルトファクトリ関数は生成された :meth:`__init__` 関数から常に呼び出されます。\n"
754769"フィールドに初期値を与える方法が他に無いので、このような動きになります。"
755770
756- #: ../../library/dataclasses.rst:530
771+ #: ../../library/dataclasses.rst:551
757772msgid "Mutable default values"
758773msgstr "可変なデフォルト値"
759774
760- #: ../../library/dataclasses.rst:532
775+ #: ../../library/dataclasses.rst:553
761776msgid ""
762777"Python stores default member variable values in class attributes. Consider "
763778"this example, not using dataclasses::"
764779msgstr ""
765780"Python はメンバ変数のデフォルト値をクラス属性に保持します。\n"
766781"データクラスを使っていない、この例を考えてみましょう::"
767782
768- #: ../../library/dataclasses.rst:547
783+ #: ../../library/dataclasses.rst:568
769784msgid ""
770785"Note that the two instances of class ``C`` share the same class variable "
771786"``x``, as expected."
772787msgstr "クラス ``C`` の 2 つのインスタンスが、予想通り同じクラス変数 ``x`` を共有していることに注意してください。"
773788
774- #: ../../library/dataclasses.rst:550
789+ #: ../../library/dataclasses.rst:571
775790msgid "Using dataclasses, *if* this code was valid::"
776791msgstr "データクラスを使っているこのコードが *もし仮に* 有効なものだとしたら::"
777792
778- #: ../../library/dataclasses.rst:558
793+ #: ../../library/dataclasses.rst:579
779794msgid "it would generate code similar to::"
780795msgstr "データクラスは次のようなコードを生成するでしょう::"
781796
782- #: ../../library/dataclasses.rst:569
797+ #: ../../library/dataclasses.rst:590
783798msgid ""
784799"This has the same issue as the original example using class ``C``. That is, "
785800"two instances of class ``D`` that do not specify a value for ``x`` when "
@@ -796,17 +811,17 @@ msgstr ""
796811"データクラスがこの問題を検出する一般的な方法を持たない代わりに、データクラスは型が ``list`` や ``dict`` や ``set`` のデフォルトパラメーターを検出した場合、 :exc:`TypeError` を送出します。\n"
797812"これは完全ではない解決法ですが、よくあるエラーの多くを防げます。"
798813
799- #: ../../library/dataclasses.rst:579
814+ #: ../../library/dataclasses.rst:600
800815msgid ""
801816"Using default factory functions is a way to create new instances of mutable "
802817"types as default values for fields::"
803818msgstr "デフォルトファクトリ関数を使うのが、フィールドのデフォルト値として可変な型の新しいインスタンスを作成する手段です::"
804819
805- #: ../../library/dataclasses.rst:589
820+ #: ../../library/dataclasses.rst:610
806821msgid "Exceptions"
807822msgstr "例外"
808823
809- #: ../../library/dataclasses.rst:593
824+ #: ../../library/dataclasses.rst:614
810825msgid ""
811826"Raised when an implicitly defined :meth:`__setattr__` or :meth:`__delattr__`"
812827" is called on a dataclass which was defined with ``frozen=True``. It is a "
0 commit comments