@@ -553,10 +553,17 @@ msgid ""
553553"markers), and the :attr:`~annotationlib.Format.STRING` format (which returns "
554554"annotations as strings)."
555555msgstr ""
556+ "新しく追加された :mod:`annotationlib` モジュールを使うことで、遅延評価となっ"
557+ "たアノテーションを取得することができます。アノテーションの評価フォーマットと"
558+ "して、 :attr:`~annotationlib.Format.VALUE` (以前のPythonバージョンと同様に、"
559+ "アノテーションの実行時の値を評価する) :attr:`~annotationlib.Format."
560+ "FORWARDREF` (未定義の名前を特別なマーカーに置き換える) :attr:"
561+ "`~annotationlib.Format.STRING` (アノテーションを文字列として返す) がありま"
562+ "す。"
556563
557564#: ../../whatsnew/3.14.rst:387
558565msgid "This example shows how these formats behave:"
559- msgstr ""
566+ msgstr "各フォーマットの挙動は以下の例の通りです: "
560567
561568#: ../../whatsnew/3.14.rst:389
562569msgid ""
@@ -572,6 +579,17 @@ msgid ""
572579">>> get_annotations(func, format=Format.STRING)\n"
573580"{'arg': 'Undefined'}"
574581msgstr ""
582+ ">>> from annotationlib import get_annotations, Format\n"
583+ ">>> def func(arg: Undefined):\n"
584+ "... pass\n"
585+ ">>> get_annotations(func, format=Format.VALUE)\n"
586+ "Traceback (most recent call last):\n"
587+ " ...\n"
588+ "NameError: name 'Undefined' is not defined\n"
589+ ">>> get_annotations(func, format=Format.FORWARDREF)\n"
590+ "{'arg': ForwardRef('Undefined', owner=<function func at 0x...>)}\n"
591+ ">>> get_annotations(func, format=Format.STRING)\n"
592+ "{'arg': 'Undefined'}"
575593
576594#: ../../whatsnew/3.14.rst:404
577595msgid "Implications for annotated code"
0 commit comments