Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edf9a45

Browse files
[po] auto sync
1 parent f13066d commit edf9a45

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

whatsnew/2.1.po

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ msgid ""
154154
"variables, the compiler will flag this by raising a :exc:`SyntaxError` "
155155
"exception."
156156
msgstr ""
157+
"此项改变的一个附带影响是在特定条件下函数作用域内部 ``from module import *`` 和 ``exec`` 语句将不允许使用。 "
158+
"Python 参考手册已经写明 ``from module import *`` 仅在模块最高层级上是可用的,但此前 CPython "
159+
"解释器从未强制实施此规则。 作为嵌套作用域具体实现的一部分,将 Python 源码转为字节码的编译器会生成不同的代码来访问某个包含作用域内的变量。 "
160+
"``from module import *`` 和 ``exec`` 会使得编译器无法正确执行,因为它们会向局部命名空间添加在编译时还不存在的名称。 "
161+
"为此,如果一个函数包含带有自由变量的函数定义或 :keyword:`lambda` 表达式,编译器将通过引发 :exc:`SyntaxError` "
162+
"异常来提示。"
157163

158164
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/whatsnew/2.1.rst:96
159165
msgid "To make the preceding explanation a bit clearer, here's an example::"
@@ -165,13 +171,15 @@ msgid ""
165171
"would define a new local variable named ``x`` whose value should be accessed"
166172
" by :func:`g`."
167173
msgstr ""
174+
"包含 ``exec`` 语句的第 4 行有语法错误,因为 ``exec`` 将定义一个名为 ``x`` 的新局部变量,它的值应当被 :func:`g` "
175+
"访问。"
168176

169177
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/whatsnew/2.1.rst:109
170178
msgid ""
171179
"This shouldn't be much of a limitation, since ``exec`` is rarely used in "
172180
"most Python code (and when it is used, it's often a sign of a poor design "
173181
"anyway)."
174-
msgstr ""
182+
msgstr "这应该不会是太大的限制,因为 ``exec`` 在多数 Python 代码中都极少被使用(而当它被使用时,往往也是个存在糟糕设计的信号)。"
175183

176184
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/whatsnew/2.1.rst:113
177185
msgid ""

whatsnew/2.2.po

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,12 @@ msgid ""
10481048
"variables, the compiler will flag this by raising a :exc:`SyntaxError` "
10491049
"exception."
10501050
msgstr ""
1051+
"此项改变的一个附带影响是在特定条件下函数作用域内部 ``from module import *`` 和 ``exec`` 语句将不允许使用。 "
1052+
"Python 参考手册已经写明 ``from module import *`` 仅在模块最高层级上是可用的,但此前 CPython "
1053+
"解释器从未强制实施此规则。 作为嵌套作用域具体实现的一部分,将 Python 源码转为字节码的编译器会生成不同的代码来访问某个包含作用域内的变量。 "
1054+
"``from module import *`` 和 ``exec`` 会使得编译器无法正确执行,因为它们会向局部命名空间添加在编译时还不存在的名称。 "
1055+
"为此,如果一个函数包含带有自由变量的函数定义或 :keyword:`lambda` 表达式,编译器将通过引发 :exc:`SyntaxError` "
1056+
"异常来提示。"
10511057

10521058
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/whatsnew/2.2.rst:907
10531059
msgid "To make the preceding explanation a bit clearer, here's an example::"
@@ -1059,13 +1065,15 @@ msgid ""
10591065
"would define a new local variable named ``x`` whose value should be accessed"
10601066
" by :func:`g`."
10611067
msgstr ""
1068+
"包含 ``exec`` 语句的第 4 行有语法错误,因为 ``exec`` 将定义一个名为 ``x`` 的新局部变量,它的值应当被 :func:`g` "
1069+
"访问。"
10621070

10631071
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/whatsnew/2.2.rst:920
10641072
msgid ""
10651073
"This shouldn't be much of a limitation, since ``exec`` is rarely used in "
10661074
"most Python code (and when it is used, it's often a sign of a poor design "
10671075
"anyway)."
1068-
msgstr ""
1076+
msgstr "这应该不会是太大的限制,因为 ``exec`` 在多数 Python 代码中都极少被使用(而当它被使用时,往往也是个存在糟糕设计的信号)。"
10691077

10701078
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/whatsnew/2.2.rst:927
10711079
msgid ":pep:`227` - Statically Nested Scopes"

0 commit comments

Comments
 (0)