@@ -661,6 +661,9 @@ msgid ""
661
661
":envvar:`PYTHONLEGACYWINDOWSFSENCODING` or call "
662
662
":func:`sys._enablelegacywindowsfsencoding`."
663
663
msgstr ""
664
+ "不使用 str 来表示路径的应用程序应当使用 :func:`os.fsencode()` 和 :func:`os.fsdecode()` 来确保 "
665
+ "bytes 被正确地编码。 要恢复以前的行为,请设置 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 或调用 "
666
+ ":func:`sys._enablelegacywindowsfsencoding`。"
664
667
665
668
#: ../../whatsnew/3.6.rst:522
666
669
msgid ""
@@ -678,13 +681,17 @@ msgid ""
678
681
"provide correctly read str objects to Python code. ``sys.stdin``, "
679
682
"``sys.stdout`` and ``sys.stderr`` now default to utf-8 encoding."
680
683
10000
msgstr ""
684
+ "现在,Windows 上的默认控制台将接受所有 Unicode 字符并为 Python 代码提供正确读取的 str 对象。``sys.stdin``, "
685
+ "``sys.stdout`` 和 ``sys.stderr`` 现在默认使用 utf-8 编码格式。"
681
686
682
687
#: ../../whatsnew/3.6.rst:535
683
688
msgid ""
684
689
"This change only applies when using an interactive console, and not when "
685
690
"redirecting files or pipes. To revert to the previous behaviour for "
686
691
"interactive console use, set :envvar:`PYTHONLEGACYWINDOWSSTDIO`."
687
692
msgstr ""
693
+ "此更改仅在使用交互式控制台时适用,而不适用于重定向文件或管道。 要恢复以前使用交互式控制台时的行为,请设置 "
694
+ ":envvar:`PYTHONLEGACYWINDOWSSTDIO`。"
688
695
689
696
#: ../../whatsnew/3.6.rst:541
690
697
msgid ":pep:`528` -- Change Windows console encoding to UTF-8"
@@ -751,6 +758,11 @@ msgid ""
751
758
"more.html>`_. The memory usage of the new :func:`dict` is between 20% and "
752
759
"25% smaller compared to Python 3.5."
753
760
msgstr ""
761
+ ":ref:`dict <typesmapping>` 类型现在会使用一种基于 `Raymond Hettinger 的提议 "
762
+ "<https://mail.python.org/pipermail/python-dev/2012-December/123028.html>`_ "
763
+ "的“紧凑”表示形式,该表示形式 `最初由 PyPy 实现 <https://morepypy.blogspot.com/2015/01/faster-"
764
+ "more-memory-efficient-and-more.html>`_。 新的The memory usage of the new "
765
+ ":func:`dict` 的内存占用相比 Python 3.5 减少了 20% 到 25%。"
754
766
755
767
#: ../../whatsnew/3.6.rst:591
756
768
msgid ""
@@ -763,13 +775,18 @@ msgid ""
763
775
" versions of the language where random iteration order is still in effect, "
764
776
"e.g. Python 3.5)."
765
777
msgstr ""
778
+ "这个新实现对原始顺序的保留被认为是一个实现细节而不应当被依赖(这在将来可能会改变,但我们希望在改变语言规范以强制所有当前和将来的 Python "
779
+ "实现都使用保留顺序的语义之前先在几个发布版的语言内部使用这个新的 dict 实现;这也有助于让仍在使用随机迭代顺序的旧版本语言例如 Python 3.5"
780
+ " 保持向下兼容性)。"
766
781
767
782
#: ../../whatsnew/3.6.rst:600
768
783
msgid ""
769
784
"(Contributed by INADA Naoki in :issue:`27350`. Idea `originally suggested by"
770
785
" Raymond Hettinger <https://mail.python.org/pipermail/python-"
771
786
"dev/2012-December/123028.html>`_.)"
772
787
msgstr ""
788
+ "(由 INADA Naoki 在 :issue:`27350` 中贡献。 该特性 `最初由 Raymond Hettinger 提议 "
789
+ "<https://mail.python.org/pipermail/python-dev/2012-December/123028.html>`_。)"
773
790
774
791
#: ../../whatsnew/3.6.rst:608
775
792
msgid "PEP 523: Adding a frame evaluation API to CPython"
@@ -78
10000
3,6 +800,8 @@ msgid ""
783
800
"any way without directly manipulating function pointers for defined "
784
801
"functions."
785
802
msgstr ""
803
+ "虽然 Python 为自定义代码执行方式提供了广泛的支持,但有一个地方它没有这样做,那就是帧对象的求值。 如果您想在 Python "
804
+ "中拦截帧的求值,那么确实没有除了直接操纵自定义函数的函数指针以外的任何办法。"
786
805
787
806
#: ../../whatsnew/3.6.rst:616
788
807
msgid ""
@@ -792,6 +811,8 @@ msgid ""
792
811
"begins. This enables the use of alternative evaluation implementations for "
793
812
"Python code, tracking frame evaluation, etc."
794
813
msgstr ""
814
+ ":pep:`523` 通过提供使帧求值在 C 语言层级上可插入的 API 从而改变了这一状况。 这将允许调试器和 JIT 等工具在 Python "
815
+ "代码开始执行之前拦截帧求值。 这样就能允许 Python 代码使用替代性求值实现,跟踪帧求值等做法。"
795
816
796
817
#: ../../whatsnew/3.6.rst:623
797
818
msgid ""
@@ -800,6 +821,8 @@ msgid ""
800
821
"very select, low-level use-cases. Semantics of the API will change with "
801
822
"Python as necessary."
802
823
msgstr ""
824
+ "这个 API 并不是受限 C API 的组成部分,它被标记为私有以表明该 API 的使用受到限制并且只适用于非常少的、低层级的用例。 这个 API "
825
+ "的语义将根据需要随 Python 的一起发生变化。"
803
826
804
827
#: ../../whatsnew/3.6.rst:630
805
828
msgid ":pep:`523` -- Adding a frame evaluation API to CPython"
@@ -961,6 +984,8 @@ msgid ""
961
984
"first use of the affected name in the same scope. Previously this was a "
962
985
":exc:`SyntaxWarning`."
963
986
msgstr ""
987
+ "现在 ``global`` 或 ``nonlocal`` 语句必须以文本形式出现在同一作用域中首次使用受影响的名称之前。 在之前版本中这只是 "
988
+ ":exc:`SyntaxWarning`。"
964
989
965
990
#: ../../whatsnew/3.6.rst:746
966
991
msgid ""
@@ -969,6 +994,9 @@ msgid ""
969
994
" if a class sets :meth:`__iter__` to ``None``, the class is not iterable. "
970
995
"(Contributed by Andrew Barnert and Ivan Levkivskyi in :issue:`25958`.)"
971
996
msgstr ""
997
+ "现在可以将某个 :ref:`特殊方法 <specialnames>` 设为 ``None`` 来表示相应操作不可用。 举例来说,如果某个类将 "
998
+ ":meth:`__iter__` 设为 ``None``,则该类就将不可迭代。 (由 Andrew Barnert 和 Ivan Levkivskyi "
999
+ "在 :issue:`25958` 中贡献。)"
972
1000
973
1001
#: ../../whatsnew/3.6.rst:752
974
1002
msgid ""
@@ -977,6 +1005,9 @@ msgid ""
977
1005
":ref:`whatsnew36-traceback` for an example). (Contributed by Emanuel Barry "
978
1006
"in :issue:`26823`.)"
979
1007
msgstr ""
1008
+ "由重复的回溯行组成的长序列现在将被简化为 ``\" [Previous line repeated {count} more times]\" `` "
1009
+ "(请参阅 :ref:`whatsnew36-traceback` 获取样例)。 (由 Emanuel Barry 在 :issue:`26823` "
1010
+ "中贡献。)"
980
1011
981
1012
#: ../../whatsnew/3.6.rst:757
982
1013
msgid ""
@@ -985,13 +1016,18 @@ msgid ""
985
1016
"checks for ImportError (in try-except) will still work. (Contributed by Eric"
986
1017
" Snow in :issue:`15767`.)"
987
1018
msgstr ""
1019
+ "现在导入操作在无法找到模块时将引发新的异常 :exc:`ModuleNotFoundError` (:exc:`ImportError` 的子类)。 "
1020
+ "目前 (在 try-except 中) 检测 ImportError 的代码仍将有效。 (由 Eric Snow 在 :issue:`15767` "
1021
+ "中贡献。)"
988
1022
989
1023
#: ../../whatsnew/3.6.rst:762
990
1024
msgid ""
<
675E
tr class="diff-line-row">991
1025
"Class methods relying on zero-argument ``super()`` will now work correctly "
992
1026
"when called from metaclass methods during class creation. (Contributed by "
993
1027
"Martin Teichmann in :issue:`23722`.)"
994
1028
msgstr ""
1029
+ "现在依赖于零参数形式 ``super()`` 的类方法在类创建期间从元类方法调用时将正确地生效。 (由 Martin Teichmann 在 "
1030
+ ":issue:`23722` 中贡献。)"
995
1031
996
1032
#: ../../whatsnew/3.6.rst:768
997
1033
msgid "New Modules"
0 commit comments