@@ -13,7 +13,7 @@ msgid ""
1313msgstr ""
1414"Project-Id-Version : Python 3.15\n "
1515"Report-Msgid-Bugs-To : \n "
16- "POT-Creation-Date : 2026-06-03 18:19 +0000\n "
16+ "POT-Creation-Date : 2026-06-05 16:27 +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/ "
@@ -1060,6 +1060,10 @@ msgid ""
10601060"argument name in the caller and callee, and consequently no call-by-"
10611061"reference. You can achieve the desired effect in a number of ways."
10621062msgstr ""
1063+ "Pythonにおける実引数は代入にて渡されることと留意してください。 代入はオブジェ"
1064+ "クトへの参照を作るだけなので、呼び出し元/先での引数名の間にエイリアスは存在せ"
1065+ "ず、従って参照渡しになりません。 目的の動作を実現するには、いくつか方法があり"
1066+ "ます。"
10631067
10641068#: ../../faq/programming.rst:518
10651069msgid "By returning a tuple of the results::"
@@ -1076,6 +1080,14 @@ msgid ""
10761080">>> func1(x, y)\n"
10771081"('new-value', 100)"
10781082msgstr ""
1083+ ">>> def func1(a, b):\n"
1084+ "... a = 'new-value' # a と b はローカル名で\n"
1085+ "... b = b + 1 # 新しいオブジェクトが代入され\n"
1086+ "... return a, b # 新しい値一式を返す\n"
1087+ "...\n"
1088+ ">>> x, y = 'old-value', 99\n"
1089+ ">>> func1(x, y)\n"
1090+ "('new-value', 100)"
10791091
10801092#: ../../faq/programming.rst:529
10811093msgid "This is almost always the clearest solution."
@@ -1103,10 +1115,18 @@ msgid ""
11031115">>> args\n"
11041116"['new-value', 100]"
11051117msgstr ""
1118+ ">>> def func2(a):\n"
1119+ "... a[0] = 'new-value' # 'a' は mutable list への参照\n"
1120+ "... a[1] = a[1] + 1 # 共有されたオブジェクトを変える\n"
1121+ "...\n"
1122+ ">>> args = ['old-value', 99]\n"
1123+ ">>> func2(args)\n"
1124+ ">>> args\n"
1125+ "['new-value', 100]"
11061126
11071127#: ../../faq/programming.rst:544
11081128msgid "By passing in a dictionary that gets mutated::"
1109- msgstr "変更される辞書に渡すことによって ::"
1129+ msgstr "変更を受ける辞書を渡すことによって ::"
11101130
11111131#: ../../faq/programming.rst:546
11121132msgid ""
@@ -1119,6 +1139,14 @@ msgid ""
11191139">>> args\n"
11201140"{'a': 'new-value', 'b': 100}"
11211141msgstr ""
1142+ ">>> def func3(args):\n"
1143+ "... args['a'] = 'new-value' # args は mutable dictionary\n"
1144+ "... args['b'] = args['b'] + 1 # インプレースで変更\n"
1145+ "...\n"
1146+ ">>> args = {'a': 'old-value', 'b': 99}\n"
1147+ ">>> func3(args)\n"
1148+ ">>> args\n"
1149+ "{'a': 'new-value', 'b': 100}"
11221150
11231151#: ../../faq/programming.rst:555
11241152msgid "Or bundle up values in a class instance::"
@@ -1140,6 +1168,19 @@ msgid ""
11401168">>> vars(args)\n"
11411169"{'a': 'new-value', 'b': 100}"
11421170msgstr ""
1171+ ">>> class Namespace:\n"
1172+ "... def __init__(self, /, **args):\n"
1173+ "... for key, value in args.items():\n"
1174+ "... setattr(self, key, value)\n"
1175+ "...\n"
1176+ ">>> def func4(args):\n"
1177+ "... args.a = 'new-value' # args は mutable Namespace\n"
1178+ "... args.b = args.b + 1 # オブジェクトをインプレースで変更\n"
1179+ "...\n"
1180+ ">>> args = Namespace(a='old-value', b=99)\n"
1181+ ">>> func4(args)\n"
1182+ ">>> vars(args)\n"
1183+ "{'a': 'new-value', 'b': 100}"
11431184
11441185#: ../../faq/programming.rst:572
11451186msgid "There's almost never a good reason to get this complicated."
0 commit comments