@@ -13,7 +13,7 @@ msgid ""
1313msgstr ""
1414"Project-Id-Version : Python 3.14\n "
1515"Report-Msgid-Bugs-To : \n "
16- "POT-Creation-Date : 2026-04-09 15:16 +0000\n "
16+ "POT-Creation-Date : 2026-04-11 14:31 +0000\n "
1717"PO-Revision-Date : 2025-09-16 00:00+0000\n "
1818"Last-Translator : TENMYO Masakazu, 2026\n "
1919"Language-Team : Japanese (https://app.transifex.com/python-doc/teams/5390/ "
@@ -508,7 +508,7 @@ msgstr "config.py::"
508508
509509#: ../../faq/programming.rst:271
510510msgid "x = 0 # Default value of the 'x' configuration setting"
511- msgstr ""
511+ msgstr "x = 0 # 'x' 設定のデフォルト値 "
512512
513513#: ../../faq/programming.rst:273
514514msgid "mod.py::"
@@ -519,6 +519,8 @@ msgid ""
519519"import config\n"
520520"config.x = 1"
521521msgstr ""
522+ "import config\n"
523+ "config.x = 1"
522524
523525#: ../../faq/programming.rst:278
524526msgid "main.py::"
@@ -530,6 +532,9 @@ msgid ""
530532"import mod\n"
531533"print(config.x)"
532534msgstr ""
535+ "import config\n"
536+ "import mod\n"
537+ "print(config.x)"
533538
534539#: ../../faq/programming.rst:284
535540msgid ""
@@ -575,12 +580,17 @@ msgid ""
575580"standard library modules -- such as :mod:`sys`, :mod:`os`, :mod:`argparse`, :"
576581"mod:`re`"
577582msgstr ""
583+ "標準ライブラリモジュール -- 例 :mod:`sys`, :mod:`os`, :mod:`argparse`, :mod:"
584+ "`re`"
578585
579586#: ../../faq/programming.rst:303
580587msgid ""
581588"third-party library modules (anything installed in Python's site-packages "
582589"directory) -- such as :pypi:`dateutil`, :pypi:`requests`, :pypi:`tzdata`"
583590msgstr ""
591+ "サードパーティのライブラリモジュール (Python の site-packages ディレクトリに"
592+ "インストールされているもの) -- 例 :pypi:`dateutil`, :pypi:`requests`, :pypi:"
593+ "`tzdata`"
584594
585595#: ../../faq/programming.rst:305
586596msgid "locally developed modules"
@@ -675,6 +685,10 @@ msgid ""
675685" mydict[key] = value\n"
676686" return mydict"
677687msgstr ""
688+ "def foo(mydict={}): # 危険:すべての呼び出しで単一辞書への参照が共有される\n"
689+ " ... compute something ...\n"
690+ " mydict[key] = value\n"
691+ " return mydict"
678692
679693#: ../../faq/programming.rst:348
680694msgid ""
@@ -726,6 +740,8 @@ msgid ""
726740"def foo(mydict={}):\n"
727741" ..."
728742msgstr ""
743+ "def foo(mydict={}):\n"
744+ " ..."
729745
730746#: ../../faq/programming.rst:369
731747msgid "but::"
@@ -737,6 +753,9 @@ msgid ""
737753" if mydict is None:\n"
738754" mydict = {} # create a new dict for local namespace"
739755msgstr ""
756+ "def foo(mydict=None):\n"
757+ " if mydict is None:\n"
758+ " mydict = {} # ローカル名前空間での新辞書作成"
740759
741760#: ../../faq/programming.rst:375
742761msgid ""
@@ -747,9 +766,9 @@ msgid ""
747766"implemented like this::"
748767msgstr ""
749768"この性質が便利なこともあります。時間のかかる計算を行う関数があるときに使われ"
750- "る一般的な技法は、関数が呼び出されるごとにパラメタと結果の値をキャッシュし、 "
751- "再び同じ値が要求されたらキャッシュされた値を返すというものです。これは "
752- "\" memoizing\" と呼ばれ、このように実装されます::"
769+ "る一般的な技法は、関数が呼び出されるごとにパラメータと結果の値をキャッシュ "
770+ "し、 再び同じ値が要求されたらキャッシュされた値を返すというものです。これはメ "
771+ "モ化( \" memoizing\" ) と呼ばれ、このように実装されます::"
753772
754773#: ../../faq/programming.rst:380
755774msgid ""
@@ -764,6 +783,16 @@ msgid ""
764783" _cache[(arg1, arg2)] = result # Store result in the cache\n"
765784" return result"
766785msgstr ""
786+ "# 呼び出し元は2つのパラメータを指定でき、キーワードにより _cache をオプショ"
787+ "ンとして渡せる\n"
788+ "def expensive(arg1, arg2, *, _cache={}):\n"
789+ " if (arg1, arg2) in _cache:\n"
790+ " return _cache[(arg1, arg2)]\n"
791+ "\n"
792+ " # 値の算出\n"
793+ " result = ... 高コストな計算 ...\n"
794+ " _cache[(arg1, arg2)] = result # 結果をキャッシュに保持\n"
795+ " return result"
767796
768797#: ../../faq/programming.rst:390
769798msgid ""
@@ -800,6 +829,11 @@ msgid ""
800829" ...\n"
801830" g(x, *args, **kwargs)"
802831msgstr ""
832+ "def f(x, *args, **kwargs):\n"
833+ " ...\n"
834+ " kwargs['width'] = '14.3c'\n"
835+ " ...\n"
836+ " g(x, *args, **kwargs)"
803837
804838#: ../../faq/programming.rst:416
805839msgid "What is the difference between arguments and parameters?"
0 commit comments