@@ -440,6 +440,12 @@ msgid ""
440
440
"of strings, filenames that cannot be decoded properly are omitted rather "
441
441
"than raising :exc:`UnicodeError`."
442
442
msgstr ""
443
+ "文件名是以(Unicode)字符串的形式传给 API 并返回的。 这可能产生特定平台专属的问题因为在某些平台上文件名强制使用字节串。 (另一方面,在 "
444
+ "Windows 上文件名则原生存储为 Unicode。) 为绕过此问题,多数接受文件名的 API(例如 :func:`open` 和 :mod:`os`"
445
+ " 模块中的许多函数)都同时接受 :class:`bytes` 对象和字符串,而少数 API 会发出要求 :class:`bytes` 返回值的提示。 "
446
+ "因而,当参数为 :class:`bytes` 的实例时 :func:`os.listdir` 会返回由 :class:`bytes` "
447
+ "实例组成的列表,:func:`os.getcwdb` 则会将当前工作目录作为 :class:`bytes` 实例返回。 请注意当 "
448
+ ":func:`os.listdir` 返回字符串的列表时,无法被正确解码的文件名会被忽略而不是引发 :exc:`UnicodeError`。"
443
449
444
450
#: ../../whatsnew/3.0.rst:325
445
451
msgid ""
@@ -532,6 +538,8 @@ msgid ""
532
538
"now assign directly to a variable in an outer (but non-global) scope. "
533
539
":keyword:`!nonlocal` is a new reserved word."
534
540
msgstr ""
541
+ ":pep:`3104`: :keyword:`nonlocal` 语句。 现在你可以使用 ``nonlocal x`` "
542
+ "直接赋值到一个外层(但非全局)作用域。 :keyword:`!nonlocal` 是新的保留字。"
535
543
536
544
#: ../../whatsnew/3.0.rst:378
537
545
msgid ""
@@ -540,6 +548,8 @@ msgid ""
540
548
"``rest`` object is always a (possibly empty) list; the right-hand side may "
541
549
"be any iterable. Example::"
542
550
msgstr ""
551
+ ":pep:`3132`: 扩展可迭代对象解包。 你现在可以编写像 ``a, b, *rest = some_sequence`` 这样的代码。 甚至 "
552
+ "``*rest, a = stuff``。 ``rest`` 对象将总是为一个(可能为空的)列表;右侧的对象可以是任意可迭代对象。 例如::"
543
553
544
554
#: ../../whatsnew/3.0.rst:385
545
555
msgid "This sets *a* to ``0``, *b* to ``4``, and *rest* to ``[1, 2, 3]``."