File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
- {"translation" : " 92.38%" , "updated_at" : " 2024-03-27T01:36:33Z " }
1
+ {"translation" : " 92.38%" , "updated_at" : " 2024-03-28T02:25:59Z " }
Original file line number Diff line number Diff line change @@ -1112,13 +1112,20 @@ msgid ""
1112
1112
"recommended only for utility scripts because it affects the global state of "
1113
1113
":data:`sys.stdout`. (Contributed by Raymond Hettinger in :issue:`15805`.)"
1114
1114
msgstr ""
1115
+ "新增的 :func:`contextlib.redirect_stdout` 上下文管理器使得工具脚本能更容易地处理将输出写入 "
1116
+ ":data:`sys.stdout` 并且不提供任何重定向选项的不灵活 API。 使用该上下文管理器,可以将 :data:`sys.stdout` "
1117
+ "的输出重定向到任何其他流,或者配合使用 :class:`io.StringIO` 来重定向到字符串。 后一种方式有时会特别有用,例如写入函数的输出来实现"
1118
+ " 命令行接口。 由于它会影响 :data:`sys.stdout` 的全局状态因此只推荐用于工具脚本。 (由 Raymond Hettinger 在 "
1119
+ ":issue:`15805` 中贡献。)"
1115
1120
1116
1121
#: ../../whatsnew/3.4.rst:698
1117
1122
msgid ""
1118
1123
"The :mod:`contextlib` documentation has also been updated to include a "
1119
1124
":ref:`discussion <single-use-reusable-and-reentrant-cms>` of the differences"
1120
1125
" between single use, reusable and reentrant context managers."
1121
1126
msgstr ""
1127
+ ":mod:`contextlib` 文档也已获得更新以包括有关仅单用、可重用与可重入上下文管理器之间的区别的 :ref:`讨论 <single-use-"
1128
+ "reusable-and-reentrant-cms>`。"
1122
1129
1123
1130
#: ../../whatsnew/3.4.rst:704
1124
1131
msgid "dbm"
@@ -1131,6 +1138,9 @@ msgid ""
1131
1138
"object will be called automatically at the end of the block. (Contributed "
1132
1139
"by Claudiu Popa and Nick Coghlan in :issue:`19282`.)"
1133
1140
msgstr ""
1141
+ "现在 :func:`dbm.open` 对象已支持上下文管理器协议。 当在 :keyword:`with` 语句中使用时,数据库对象的 "
1142
+ "``close`` 方法将在代码块结束时被自动调用。 (由 Claudiu Popa 和 Nick Coghlan 在 :issue:`19282` "
1143
+ "中贡献。)"
1134
1144
1135
1145
#: ../../whatsnew/3.4.rst:713
1136
1146
msgid "dis"
You can’t perform that action at this time.
0 commit comments