@@ -24,7 +24,7 @@ msgstr ""
2424
2525#: ../../howto/annotations.rst:5
2626msgid "Annotations Best Practices"
27- msgstr ""
27+ msgstr "アノテーションのベストプラクティス "
2828
2929#: ../../howto/annotations.rst:0
3030msgid "author"
@@ -45,6 +45,9 @@ msgid ""
4545"``__annotations__`` on Python objects, we encourage you to follow the "
4646"guidelines described below."
4747msgstr ""
48+ "このドキュメントは、アノテーションの辞書を扱う上でのベストプラクティスをまと"
49+ "めるものです。Python オブジェクトに付与された ``__annotations__`` を Python "
50+ "コードからアクセスする際には、以下のガイドラインに従うことを推奨します。"
4851
4952#: ../../howto/annotations.rst:16
5053msgid ""
@@ -54,6 +57,11 @@ msgid ""
5457"and older, other best practices for ``__annotations__`` that apply to any "
5558"Python version, and quirks of ``__annotations__``."
5659msgstr ""
60+ "本ドキュメントは次の4セクションで構成されています。Python 3.10 以降でオブ"
61+ "ジェクトのアノテーションにアクセスするときのベストプラクティス、Python 3.9 以"
62+ "下でオブジェクトのアノテーションにアクセスするときのベストプラクティス、"
63+ "Python バージョンに関わらない ``__annotations__`` に関するベストプラクティ"
64+ "ス、 ``__annotations__`` の注意点、です。"
5765
5866#: ../../howto/annotations.rst:26
5967msgid ""
@@ -62,10 +70,13 @@ msgid ""
6270"information on how to use \" type hints\" in your code, please see the :mod:"
6371"`typing` module."
6472msgstr ""
73+ "注意:本ドキュメントは、アノテーションの使い方ではなく、 ``__annotations__`` "
74+ "の使い方を扱っています。型ヒントをコードの中でどうやって使うかについては、 :"
75+ "mod:`typing` モジュールを参照してください。"
6576
6677#: ../../howto/annotations.rst:33
6778msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer"
68- msgstr ""
79+ msgstr "オブジェクトのアノテーション辞書へのアクセス (Python 3.10 以降) "
6980
7081#: ../../howto/annotations.rst:35
7182msgid ""
@@ -75,6 +86,11 @@ msgid ""
7586"object that supports annotations. This function can also \" un-stringize\" "
7687"stringized annotations for you."
7788msgstr ""
89+ "Python 3.10 で標準ライブラリに :func:`inspect.get_annotations` 関数が新たに追"
90+ "加されました。Python 3.10 から 3.13 までは、アノテーションに対応しているオブ"
91+ "ジェクトのアノテーション辞書にアクセスするには、この関数を使うのが一番良いで"
92+ "す。文字列で指定されたアノテーションも自動的に文字列でない値に解決してくれま"
93+ "す。"
7894
7995#: ../../howto/annotations.rst:42
8096msgid ""
@@ -83,6 +99,9 @@ msgid ""
8399"`annotationlib.get_annotations` function, which supersedes :func:`inspect."
84100"get_annotations`."
85101msgstr ""
102+ "Python 3.14 では、アノテーションを扱うためのモジュール :mod:`annotationlib` "
103+ "が追加されました。このモジュールに :func:`annotationlib.get_annotations` があ"
104+ "り、 :func:`inspect.get_annotations` を置き換えるものです。"
86105
87106#: ../../howto/annotations.rst:47
88107msgid ""
@@ -94,6 +113,12 @@ msgid ""
94113"of these three *specific* objects, you may simply use ``o.__annotations__`` "
95114"to get at the object's annotations dict."
96115msgstr ""
116+ "もし何らかの理由で自分の用途に :func:`inspect.get_annotations` が合わないとい"
117+ "う場合は、手動で ``__annotations__`` にアクセスすることもできます。これについ"
118+ "ても、推奨のアクセス方法が Python 3.10 で変わりました。3.10 で、 ``o."
119+ "__annotations__`` は関数、クラス、モジュールに対しては必ず使えることが保証さ"
120+ "れるようになりました。オブジェクトが確実にこの3つのいずれかである場合は、単"
121+ "に ``o.__annotations__`` を使えばアノテーション辞書を取得できます。"
97122
98123#: ../../howto/annotations.rst:57
99124msgid ""
0 commit comments