-
-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy path3.7.po
3737 lines (3169 loc) · 129 KB
/
3.7.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-26 00:14+0000\n"
"PO-Revision-Date: 2018-07-15 18:56+0800\n"
"Last-Translator: \n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../whatsnew/3.7.rst:3
msgid "What's New In Python 3.7"
msgstr "Python 3.7 有什麼新功能"
#: ../../whatsnew/3.7.rst:0
msgid "Editor"
msgstr "編輯者"
#: ../../whatsnew/3.7.rst:5
msgid "Elvis Pranskevichus <[email protected]>"
msgstr "Elvis Pranskevichus <[email protected]>"
#: ../../whatsnew/3.7.rst:47
msgid ""
"This article explains the new features in Python 3.7, compared to 3.6. "
"Python 3.7 was released on June 27, 2018. For full details, see the :ref:"
"`changelog <changelog>`."
msgstr ""
"本文介紹了 Python 3.7 與 3.6 相比多了哪些新功能。Python 3.7 已於 2018 年 6 "
"月 27 日發布。有關完整詳細資訊,請參閱 :ref:`changelog <changelog>`。"
#: ../../whatsnew/3.7.rst:53
msgid "Summary -- Release Highlights"
msgstr "發布重點摘要"
#: ../../whatsnew/3.7.rst:58
msgid "New syntax features:"
msgstr "新增語法特性:"
#: ../../whatsnew/3.7.rst:60
msgid ""
":ref:`PEP 563 <whatsnew37-pep563>`, postponed evaluation of type annotations."
msgstr ""
#: ../../whatsnew/3.7.rst:62
msgid "Backwards incompatible syntax changes:"
msgstr ""
#: ../../whatsnew/3.7.rst:64
msgid ":keyword:`async` and :keyword:`await` are now reserved keywords."
msgstr ":keyword:`async` 和 :keyword:`await` 現為保留關鍵字。"
#: ../../whatsnew/3.7.rst:66
msgid "New library modules:"
msgstr "新的函式庫模組:"
#: ../../whatsnew/3.7.rst:68
msgid ""
":mod:`contextvars`: :ref:`PEP 567 -- Context Variables <whatsnew37-pep567>`"
msgstr ""
#: ../../whatsnew/3.7.rst:69
msgid ":mod:`dataclasses`: :ref:`PEP 557 -- Data Classes <whatsnew37-pep557>`"
msgstr ""
#: ../../whatsnew/3.7.rst:70
msgid ":ref:`whatsnew37_importlib_resources`"
msgstr ":ref:`whatsnew37_importlib_resources`"
#: ../../whatsnew/3.7.rst:72
msgid "New built-in features:"
msgstr "新的內建功能:"
#: ../../whatsnew/3.7.rst:74
msgid ""
":ref:`PEP 553 <whatsnew37-pep553>`, the new :func:`breakpoint` function."
msgstr ""
#: ../../whatsnew/3.7.rst:76
msgid "Python data model improvements:"
msgstr "Python 資料模型改進:"
#: ../../whatsnew/3.7.rst:78
msgid ""
":ref:`PEP 562 <whatsnew37-pep562>`, customization of access to module "
"attributes."
msgstr ""
#: ../../whatsnew/3.7.rst:81
msgid ""
":ref:`PEP 560 <whatsnew37-pep560>`, core support for typing module and "
"generic types."
msgstr ""
#: ../../whatsnew/3.7.rst:84
msgid ""
"the insertion-order preservation nature of :ref:`dict <typesmapping>` "
"objects `has been declared`_ to be an official part of the Python language "
"spec."
msgstr ""
#: ../../whatsnew/3.7.rst:90
msgid "Significant improvements in the standard library:"
msgstr "標準函式庫中的顯著改進"
#: ../../whatsnew/3.7.rst:92
msgid ""
"The :mod:`asyncio` module has received new features, significant :ref:"
"`usability and performance improvements <whatsnew37_asyncio>`."
msgstr ""
#: ../../whatsnew/3.7.rst:95
msgid ""
"The :mod:`time` module gained support for :ref:`functions with nanosecond "
"resolution <whatsnew37-pep564>`."
msgstr ""
#: ../../whatsnew/3.7.rst:98
msgid "CPython implementation improvements:"
msgstr ""
#: ../../whatsnew/3.7.rst:100
msgid "Avoiding the use of ASCII as a default text encoding:"
msgstr ""
#: ../../whatsnew/3.7.rst:102
msgid ":ref:`PEP 538 <whatsnew37-pep538>`, legacy C locale coercion"
msgstr ""
#: ../../whatsnew/3.7.rst:103
msgid ":ref:`PEP 540 <whatsnew37-pep540>`, forced UTF-8 runtime mode"
msgstr ""
#: ../../whatsnew/3.7.rst:104
msgid ":ref:`PEP 552 <whatsnew37-pep552>`, deterministic .pycs"
msgstr ""
#: ../../whatsnew/3.7.rst:105
msgid ":ref:`New Python Development Mode <whatsnew37-devmode>`"
msgstr ":ref:`新版 Python 開發模式 <whatsnew37-devmode>`"
#: ../../whatsnew/3.7.rst:106
msgid ""
":ref:`PEP 565 <whatsnew37-pep565>`, improved :exc:`DeprecationWarning` "
"handling"
msgstr ""
#: ../../whatsnew/3.7.rst:109
msgid "C API improvements:"
msgstr "C API 改進:"
#: ../../whatsnew/3.7.rst:111
msgid ":ref:`PEP 539 <whatsnew37-pep539>`, new C API for thread-local storage"
msgstr ""
#: ../../whatsnew/3.7.rst:113
msgid "Documentation improvements:"
msgstr ""
#: ../../whatsnew/3.7.rst:115
msgid ":ref:`PEP 545 <whatsnew37-pep545>`, Python documentation translations"
msgstr ""
#: ../../whatsnew/3.7.rst:116
msgid ""
"New documentation translations: `Japanese <https://docs.python.org/ja/>`_, "
"`French <https://docs.python.org/fr/>`_, and `Korean <https://docs.python."
"org/ko/>`_."
msgstr ""
#: ../../whatsnew/3.7.rst:120
msgid ""
"This release features notable performance improvements in many areas. The :"
"ref:`whatsnew37-perf` section lists them in detail."
msgstr ""
#: ../../whatsnew/3.7.rst:123
msgid ""
"For a list of changes that may affect compatibility with previous Python "
"releases please refer to the :ref:`porting-to-python-37` section."
msgstr ""
#: ../../whatsnew/3.7.rst:128
msgid "New Features"
msgstr "新增功能"
#: ../../whatsnew/3.7.rst:133
msgid "PEP 563: Postponed Evaluation of Annotations"
msgstr ""
#: ../../whatsnew/3.7.rst:135
msgid ""
"The advent of type hints in Python uncovered two glaring usability issues "
"with the functionality of annotations added in :pep:`3107` and refined "
"further in :pep:`526`:"
msgstr ""
#: ../../whatsnew/3.7.rst:139
msgid ""
"annotations could only use names which were already available in the current "
"scope, in other words they didn't support forward references of any kind; and"
msgstr ""
#: ../../whatsnew/3.7.rst:143
msgid ""
"annotating source code had adverse effects on startup time of Python "
"programs."
msgstr ""
#: ../../whatsnew/3.7.rst:146
msgid ""
"Both of these issues are fixed by postponing the evaluation of annotations. "
"Instead of compiling code which executes expressions in annotations at their "
"definition time, the compiler stores the annotation in a string form "
"equivalent to the AST of the expression in question. If needed, annotations "
"can be resolved at runtime using :func:`typing.get_type_hints`. In the "
"common case where this is not required, the annotations are cheaper to store "
"(since short strings are interned by the interpreter) and make startup time "
"faster."
msgstr ""
#: ../../whatsnew/3.7.rst:155
msgid ""
"Usability-wise, annotations now support forward references, making the "
"following syntax valid::"
msgstr ""
#: ../../whatsnew/3.7.rst:158
msgid ""
"class C:\n"
" @classmethod\n"
" def from_string(cls, source: str) -> C:\n"
" ...\n"
"\n"
" def validate_b(self, obj: B) -> bool:\n"
" ...\n"
"\n"
"class B:\n"
" ..."
msgstr ""
"class C:\n"
" @classmethod\n"
" def from_string(cls, source: str) -> C:\n"
" ...\n"
"\n"
" def validate_b(self, obj: B) -> bool:\n"
" ...\n"
"\n"
"class B:\n"
" ..."
#: ../../whatsnew/3.7.rst:169
msgid ""
"Since this change breaks compatibility, the new behavior needs to be enabled "
"on a per-module basis in Python 3.7 using a :mod:`__future__` import::"
msgstr ""
#: ../../whatsnew/3.7.rst:172
msgid "from __future__ import annotations"
msgstr ""
#: ../../whatsnew/3.7.rst:174
msgid "It will become the default in Python 3.10."
msgstr ""
#: ../../whatsnew/3.7.rst:178
msgid ":pep:`563` -- Postponed evaluation of annotations"
msgstr ""
#: ../../whatsnew/3.7.rst:179
msgid "PEP written and implemented by Łukasz Langa."
msgstr ""
#: ../../whatsnew/3.7.rst:185
msgid "PEP 538: Legacy C Locale Coercion"
msgstr ""
#: ../../whatsnew/3.7.rst:187
msgid ""
"An ongoing challenge within the Python 3 series has been determining a "
"sensible default strategy for handling the \"7-bit ASCII\" text encoding "
"assumption currently implied by the use of the default C or POSIX locale on "
"non-Windows platforms."
msgstr ""
#: ../../whatsnew/3.7.rst:192
msgid ""
":pep:`538` updates the default interpreter command line interface to "
"automatically coerce that locale to an available UTF-8 based locale as "
"described in the documentation of the new :envvar:`PYTHONCOERCECLOCALE` "
"environment variable. Automatically setting ``LC_CTYPE`` this way means that "
"both the core interpreter and locale-aware C extensions (such as :mod:"
"`readline`) will assume the use of UTF-8 as the default text encoding, "
"rather than ASCII."
msgstr ""
#: ../../whatsnew/3.7.rst:200
msgid ""
"The platform support definition in :pep:`11` has also been updated to limit "
"full text handling support to suitably configured non-ASCII based locales."
msgstr ""
#: ../../whatsnew/3.7.rst:203
msgid ""
"As part of this change, the default error handler for :data:`~sys.stdin` "
"and :data:`~sys.stdout` is now ``surrogateescape`` (rather than ``strict``) "
"when using any of the defined coercion target locales (currently ``C."
"UTF-8``, ``C.utf8``, and ``UTF-8``). The default error handler for :data:"
"`~sys.stderr` continues to be ``backslashreplace``, regardless of locale."
msgstr ""
#: ../../whatsnew/3.7.rst:209
msgid ""
"Locale coercion is silent by default, but to assist in debugging potentially "
"locale related integration problems, explicit warnings (emitted directly on :"
"data:`~sys.stderr`) can be requested by setting "
"``PYTHONCOERCECLOCALE=warn``. This setting will also cause the Python "
"runtime to emit a warning if the legacy C locale remains active when the "
"core interpreter is initialized."
msgstr ""
#: ../../whatsnew/3.7.rst:215
msgid ""
"While :pep:`538`'s locale coercion has the benefit of also affecting "
"extension modules (such as GNU ``readline``), as well as child processes "
"(including those running non-Python applications and older versions of "
"Python), it has the downside of requiring that a suitable target locale be "
"present on the running system. To better handle the case where no suitable "
"target locale is available (as occurs on RHEL/CentOS 7, for example), Python "
"3.7 also implements :ref:`whatsnew37-pep540`."
msgstr ""
#: ../../whatsnew/3.7.rst:225
msgid ":pep:`538` -- Coercing the legacy C locale to a UTF-8 based locale"
msgstr ""
#: ../../whatsnew/3.7.rst:226
msgid "PEP written and implemented by Nick Coghlan."
msgstr "由 Nick Coghlan 撰寫 PEP 與實作。"
#: ../../whatsnew/3.7.rst:232
msgid "PEP 540: Forced UTF-8 Runtime Mode"
msgstr ""
#: ../../whatsnew/3.7.rst:234
msgid ""
"The new :option:`-X` ``utf8`` command line option and :envvar:`PYTHONUTF8` "
"environment variable can be used to enable the :ref:`Python UTF-8 Mode <utf8-"
"mode>`."
msgstr ""
#: ../../whatsnew/3.7.rst:238
msgid ""
"When in UTF-8 mode, CPython ignores the locale settings, and uses the UTF-8 "
"encoding by default. The error handlers for :data:`sys.stdin` and :data:"
"`sys.stdout` streams are set to ``surrogateescape``."
msgstr ""
#: ../../whatsnew/3.7.rst:242
msgid ""
"The forced UTF-8 mode can be used to change the text handling behavior in an "
"embedded Python interpreter without changing the locale settings of an "
"embedding application."
msgstr ""
#: ../../whatsnew/3.7.rst:246
msgid ""
"While :pep:`540`'s UTF-8 mode has the benefit of working regardless of which "
"locales are available on the running system, it has the downside of having "
"no effect on extension modules (such as GNU ``readline``), child processes "
"running non-Python applications, and child processes running older versions "
"of Python. To reduce the risk of corrupting text data when communicating "
"with such components, Python 3.7 also implements :ref:`whatsnew37-pep540`)."
msgstr ""
#: ../../whatsnew/3.7.rst:253
msgid ""
"The UTF-8 mode is enabled by default when the locale is ``C`` or ``POSIX``, "
"and the :pep:`538` locale coercion feature fails to change it to a UTF-8 "
"based alternative (whether that failure is due to ``PYTHONCOERCECLOCALE=0`` "
"being set, ``LC_ALL`` being set, or the lack of a suitable target locale)."
msgstr ""
#: ../../whatsnew/3.7.rst:260
msgid ":pep:`540` -- Add a new UTF-8 mode"
msgstr ""
#: ../../whatsnew/3.7.rst:261 ../../whatsnew/3.7.rst:363
msgid "PEP written and implemented by Victor Stinner"
msgstr "由 Victor Stinner 撰寫 PEP 與實作"
#: ../../whatsnew/3.7.rst:267
msgid "PEP 553: Built-in ``breakpoint()``"
msgstr ""
#: ../../whatsnew/3.7.rst:269
msgid ""
"Python 3.7 includes the new built-in :func:`breakpoint` function as an easy "
"and consistent way to enter the Python debugger."
msgstr ""
#: ../../whatsnew/3.7.rst:272
msgid ""
"Built-in ``breakpoint()`` calls :func:`sys.breakpointhook`. By default, the "
"latter imports :mod:`pdb` and then calls ``pdb.set_trace()``, but by binding "
"``sys.breakpointhook()`` to the function of your choosing, ``breakpoint()`` "
"can enter any debugger. Additionally, the environment variable :envvar:"
"`PYTHONBREAKPOINT` can be set to the callable of your debugger of choice. "
"Set ``PYTHONBREAKPOINT=0`` to completely disable built-in ``breakpoint()``."
msgstr ""
#: ../../whatsnew/3.7.rst:282
msgid ":pep:`553` -- Built-in breakpoint()"
msgstr ""
#: ../../whatsnew/3.7.rst:283
msgid "PEP written and implemented by Barry Warsaw"
msgstr "由 Barry Warsaw 撰寫 PEP 與實作"
#: ../../whatsnew/3.7.rst:289
msgid "PEP 539: New C API for Thread-Local Storage"
msgstr ""
#: ../../whatsnew/3.7.rst:291
msgid ""
"While Python provides a C API for thread-local storage support; the "
"existing :ref:`Thread Local Storage (TLS) API <thread-local-storage-api>` "
"has used :c:expr:`int` to represent TLS keys across all platforms. This has "
"not generally been a problem for officially support platforms, but that is "
"neither POSIX-compliant, nor portable in any practical sense."
msgstr ""
#: ../../whatsnew/3.7.rst:297
msgid ""
":pep:`539` changes this by providing a new :ref:`Thread Specific Storage "
"(TSS) API <thread-specific-storage-api>` to CPython which supersedes use of "
"the existing TLS API within the CPython interpreter, while deprecating the "
"existing API. The TSS API uses a new type :c:type:`Py_tss_t` instead of :c:"
"expr:`int` to represent TSS keys--an opaque type the definition of which may "
"depend on the underlying TLS implementation. Therefore, this will allow to "
"build CPython on platforms where the native TLS key is defined in a way that "
"cannot be safely cast to :c:expr:`int`."
msgstr ""
#: ../../whatsnew/3.7.rst:306
msgid ""
"Note that on platforms where the native TLS key is defined in a way that "
"cannot be safely cast to :c:expr:`int`, all functions of the existing TLS "
"API will be no-op and immediately return failure. This indicates clearly "
"that the old API is not supported on platforms where it cannot be used "
"reliably, and that no effort will be made to add such support."
msgstr ""
#: ../../whatsnew/3.7.rst:314
msgid ":pep:`539` -- A New C-API for Thread-Local Storage in CPython"
msgstr ""
#: ../../whatsnew/3.7.rst:315
msgid "PEP written by Erik M. Bray; implementation by Masayuki Yamamoto."
msgstr "PEP 由 Erik M. Bray 撰寫;由 Masayuki Yamamoto 實作。"
#: ../../whatsnew/3.7.rst:321
msgid "PEP 562: Customization of Access to Module Attributes"
msgstr ""
#: ../../whatsnew/3.7.rst:323
msgid ""
"Python 3.7 allows defining :meth:`__getattr__` on modules and will call it "
"whenever a module attribute is otherwise not found. Defining :meth:"
"`__dir__` on modules is now also allowed."
msgstr ""
#: ../../whatsnew/3.7.rst:327
msgid ""
"A typical example of where this may be useful is module attribute "
"deprecation and lazy loading."
msgstr ""
#: ../../whatsnew/3.7.rst:332
msgid ":pep:`562` -- Module ``__getattr__`` and ``__dir__``"
msgstr ":pep:`562` -- ``__getattr__`` 與 ``__dir__`` 模組"
#: ../../whatsnew/3.7.rst:333 ../../whatsnew/3.7.rst:422
msgid "PEP written and implemented by Ivan Levkivskyi"
msgstr "由 Ivan Levkivskyi 撰寫 PEP 與實作"
#: ../../whatsnew/3.7.rst:339
msgid "PEP 564: New Time Functions With Nanosecond Resolution"
msgstr ""
#: ../../whatsnew/3.7.rst:341
msgid ""
"The resolution of clocks in modern systems can exceed the limited precision "
"of a floating-point number returned by the :func:`time.time` function and "
"its variants. To avoid loss of precision, :pep:`564` adds six new "
"\"nanosecond\" variants of the existing timer functions to the :mod:`time` "
"module:"
msgstr ""
#: ../../whatsnew/3.7.rst:347 ../../whatsnew/3.7.rst:1451
msgid ":func:`time.clock_gettime_ns`"
msgstr ":func:`time.clock_gettime_ns`"
#: ../../whatsnew/3.7.rst:348 ../../whatsnew/3.7.rst:1452
msgid ":func:`time.clock_settime_ns`"
msgstr ":func:`time.clock_settime_ns`"
#: ../../whatsnew/3.7.rst:349 ../../whatsnew/3.7.rst:1453
msgid ":func:`time.monotonic_ns`"
msgstr ":func:`time.monotonic_ns`"
#: ../../whatsnew/3.7.rst:350 ../../whatsnew/3.7.rst:1454
msgid ":func:`time.perf_counter_ns`"
msgstr ":func:`time.perf_counter_ns`"
#: ../../whatsnew/3.7.rst:351 ../../whatsnew/3.7.rst:1455
msgid ":func:`time.process_time_ns`"
msgstr ":func:`time.process_time_ns`"
#: ../../whatsnew/3.7.rst:352 ../../whatsnew/3.7.rst:1456
msgid ":func:`time.time_ns`"
msgstr ":func:`time.time_ns`"
#: ../../whatsnew/3.7.rst:354
msgid "The new functions return the number of nanoseconds as an integer value."
msgstr ""
#: ../../whatsnew/3.7.rst:356
msgid ""
":pep:`Measurements <0564#annex-clocks-resolution-in-python>` show that on "
"Linux and Windows the resolution of :func:`time.time_ns` is approximately 3 "
"times better than that of :func:`time.time`."
msgstr ""
#: ../../whatsnew/3.7.rst:362
msgid ":pep:`564` -- Add new time functions with nanosecond resolution"
msgstr ""
#: ../../whatsnew/3.7.rst:369
msgid "PEP 565: Show DeprecationWarning in ``__main__``"
msgstr ""
#: ../../whatsnew/3.7.rst:371
msgid ""
"The default handling of :exc:`DeprecationWarning` has been changed such that "
"these warnings are once more shown by default, but only when the code "
"triggering them is running directly in the :mod:`__main__` module. As a "
"result, developers of single file scripts and those using Python "
"interactively should once again start seeing deprecation warnings for the "
"APIs they use, but deprecation warnings triggered by imported application, "
"library and framework modules will continue to be hidden by default."
msgstr ""
#: ../../whatsnew/3.7.rst:379
msgid ""
"As a result of this change, the standard library now allows developers to "
"choose between three different deprecation warning behaviours:"
msgstr ""
#: ../../whatsnew/3.7.rst:382
msgid ""
":exc:`FutureWarning`: always displayed by default, recommended for warnings "
"intended to be seen by application end users (e.g. for deprecated "
"application configuration settings)."
msgstr ""
#: ../../whatsnew/3.7.rst:385
msgid ""
":exc:`DeprecationWarning`: displayed by default only in :mod:`__main__` and "
"when running tests, recommended for warnings intended to be seen by other "
"Python developers where a version upgrade may result in changed behaviour or "
"an error."
msgstr ""
#: ../../whatsnew/3.7.rst:389
msgid ""
":exc:`PendingDeprecationWarning`: displayed by default only when running "
"tests, intended for cases where a future version upgrade will change the "
"warning category to :exc:`DeprecationWarning` or :exc:`FutureWarning`."
msgstr ""
#: ../../whatsnew/3.7.rst:393
msgid ""
"Previously both :exc:`DeprecationWarning` and :exc:"
"`PendingDeprecationWarning` were only visible when running tests, which "
"meant that developers primarily writing single file scripts or using Python "
"interactively could be surprised by breaking changes in the APIs they used."
msgstr ""
#: ../../whatsnew/3.7.rst:400
msgid ":pep:`565` -- Show DeprecationWarning in ``__main__``"
msgstr ":pep:`565` -- 在 ``__main__`` 中顯示 DeprecationWarning"
#: ../../whatsnew/3.7.rst:401
msgid "PEP written and implemented by Nick Coghlan"
msgstr "由 Nick Coghlan 撰寫 PEP 與實作"
#: ../../whatsnew/3.7.rst:407
msgid "PEP 560: Core Support for ``typing`` module and Generic Types"
msgstr ""
#: ../../whatsnew/3.7.rst:409
msgid ""
"Initially :pep:`484` was designed in such way that it would not introduce "
"*any* changes to the core CPython interpreter. Now type hints and the :mod:"
"`typing` module are extensively used by the community, so this restriction "
"is removed. The PEP introduces two special methods :meth:`__class_getitem__` "
"and ``__mro_entries__``, these methods are now used by most classes and "
"special constructs in :mod:`typing`. As a result, the speed of various "
"operations with types increased up to 7 times, the generic types can be used "
"without metaclass conflicts, and several long standing bugs in :mod:`typing` "
"module are fixed."
msgstr ""
#: ../../whatsnew/3.7.rst:421
msgid ":pep:`560` -- Core support for typing module and generic types"
msgstr ""
#: ../../whatsnew/3.7.rst:428
msgid "PEP 552: Hash-based .pyc Files"
msgstr ""
#: ../../whatsnew/3.7.rst:430
msgid ""
"Python has traditionally checked the up-to-dateness of bytecode cache files "
"(i.e., ``.pyc`` files) by comparing the source metadata (last-modified "
"timestamp and size) with source metadata saved in the cache file header when "
"it was generated. While effective, this invalidation method has its "
"drawbacks. When filesystem timestamps are too coarse, Python can miss "
"source updates, leading to user confusion. Additionally, having a timestamp "
"in the cache file is problematic for `build reproducibility <https://"
"reproducible-builds.org/>`_ and content-based build systems."
msgstr ""
#: ../../whatsnew/3.7.rst:439
msgid ""
":pep:`552` extends the pyc format to allow the hash of the source file to be "
"used for invalidation instead of the source timestamp. Such ``.pyc`` files "
"are called \"hash-based\". By default, Python still uses timestamp-based "
"invalidation and does not generate hash-based ``.pyc`` files at runtime. "
"Hash-based ``.pyc`` files may be generated with :mod:`py_compile` or :mod:"
"`compileall`."
msgstr ""
#: ../../whatsnew/3.7.rst:445
msgid ""
"Hash-based ``.pyc`` files come in two variants: checked and unchecked. "
"Python validates checked hash-based ``.pyc`` files against the corresponding "
"source files at runtime but doesn't do so for unchecked hash-based pycs. "
"Unchecked hash-based ``.pyc`` files are a useful performance optimization "
"for environments where a system external to Python (e.g., the build system) "
"is responsible for keeping ``.pyc`` files up-to-date."
msgstr ""
#: ../../whatsnew/3.7.rst:452
msgid "See :ref:`pyc-invalidation` for more information."
msgstr "更多資訊請見 :ref:`pyc-invalidation`。"
#: ../../whatsnew/3.7.rst:456
msgid ":pep:`552` -- Deterministic pycs"
msgstr ""
#: ../../whatsnew/3.7.rst:457
msgid "PEP written and implemented by Benjamin Peterson"
msgstr "由 Benjamin Peterson 撰寫 PEP 與實作"
#: ../../whatsnew/3.7.rst:463
msgid "PEP 545: Python Documentation Translations"
msgstr "PEP 545:Python 文件翻譯"
#: ../../whatsnew/3.7.rst:465
msgid ""
":pep:`545` describes the process of creating and maintaining Python "
"documentation translations."
msgstr ""
#: ../../whatsnew/3.7.rst:468
msgid "Three new translations have been added:"
msgstr ""
#: ../../whatsnew/3.7.rst:470
msgid "Japanese: https://docs.python.org/ja/"
msgstr "日文:https://docs.python.org/ja/"
#: ../../whatsnew/3.7.rst:471
msgid "French: https://docs.python.org/fr/"
msgstr "法文:https://docs.python.org/fr/"
#: ../../whatsnew/3.7.rst:472
msgid "Korean: https://docs.python.org/ko/"
msgstr "韓文:https://docs.python.org/ko/"
#: ../../whatsnew/3.7.rst:476
msgid ":pep:`545` -- Python Documentation Translations"
msgstr ":pep:`545` -- Python 文件翻譯"
#: ../../whatsnew/3.7.rst:477
msgid ""
"PEP written and implemented by Julien Palard, Inada Naoki, and Victor "
"Stinner."
msgstr "PEP 由 Julien Palard、Inada Naoki 與 Victor Stinner 撰寫。"
#: ../../whatsnew/3.7.rst:484
msgid "Python Development Mode (-X dev)"
msgstr ""
#: ../../whatsnew/3.7.rst:486
msgid ""
"The new :option:`-X` ``dev`` command line option or the new :envvar:"
"`PYTHONDEVMODE` environment variable can be used to enable :ref:`Python "
"Development Mode <devmode>`. When in development mode, Python performs "
"additional runtime checks that are too expensive to be enabled by default. "
"See :ref:`Python Development Mode <devmode>` documentation for the full "
"description."
msgstr ""
#: ../../whatsnew/3.7.rst:495
msgid "Other Language Changes"
msgstr "其他語言更動"
#: ../../whatsnew/3.7.rst:497
msgid ""
"An :keyword:`await` expression and comprehensions containing an :keyword:"
"`async for` clause were illegal in the expressions in :ref:`formatted string "
"literals <f-strings>` due to a problem with the implementation. In Python "
"3.7 this restriction was lifted."
msgstr ""
#: ../../whatsnew/3.7.rst:502
msgid ""
"More than 255 arguments can now be passed to a function, and a function can "
"now have more than 255 parameters. (Contributed by Serhiy Storchaka in :"
"issue:`12844` and :issue:`18896`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:506
msgid ""
":meth:`bytes.fromhex` and :meth:`bytearray.fromhex` now ignore all ASCII "
"whitespace, not only spaces. (Contributed by Robert Xiao in :issue:`28927`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:509
msgid ""
":class:`str`, :class:`bytes`, and :class:`bytearray` gained support for the "
"new :meth:`isascii() <str.isascii>` method, which can be used to test if a "
"string or bytes contain only the ASCII characters. (Contributed by INADA "
"Naoki in :issue:`32677`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:514
msgid ""
":exc:`ImportError` now displays module name and module ``__file__`` path "
"when ``from ... import ...`` fails. (Contributed by Matthias Bussonnier in :"
"issue:`29546`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:518
msgid ""
"Circular imports involving absolute imports with binding a submodule to a "
"name are now supported. (Contributed by Serhiy Storchaka in :issue:`30024`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:522
msgid ""
"``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than "
"``format(str(self), '')``. (Contributed by Serhiy Storchaka in :issue:"
"`28974`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:526
msgid ""
"In order to better support dynamic creation of stack traces, :class:`types."
"TracebackType` can now be instantiated from Python code, and the :attr:"
"`~traceback.tb_next` attribute on :ref:`tracebacks <traceback-objects>` is "
"now writable. (Contributed by Nathaniel J. Smith in :issue:`30579`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:532
msgid ""
"When using the :option:`-m` switch, ``sys.path[0]`` is now eagerly expanded "
"to the full starting directory path, rather than being left as the empty "
"directory (which allows imports from the *current* working directory at the "
"time when an import occurs) (Contributed by Nick Coghlan in :issue:`33053`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:538
msgid ""
"The new :option:`-X` ``importtime`` option or the :envvar:"
"`PYTHONPROFILEIMPORTTIME` environment variable can be used to show the "
"timing of each module import. (Contributed by Inada Naoki in :issue:`31415`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:545
msgid "New Modules"
msgstr "新模組"
#: ../../whatsnew/3.7.rst:550
msgid "contextvars"
msgstr "contextvars"
#: ../../whatsnew/3.7.rst:552
msgid ""
"The new :mod:`contextvars` module and a set of :ref:`new C APIs "
"<contextvarsobjects>` introduce support for *context variables*. Context "
"variables are conceptually similar to thread-local variables. Unlike TLS, "
"context variables support asynchronous code correctly."
msgstr ""
#: ../../whatsnew/3.7.rst:558
msgid ""
"The :mod:`asyncio` and :mod:`decimal` modules have been updated to use and "
"support context variables out of the box. Particularly the active decimal "
"context is now stored in a context variable, which allows decimal operations "
"to work with the correct context in asynchronous code."
msgstr ""
#: ../../whatsnew/3.7.rst:565
msgid ":pep:`567` -- Context Variables"
msgstr ""
#: ../../whatsnew/3.7.rst:566
msgid "PEP written and implemented by Yury Selivanov"
msgstr "由 Yury Selivanov 撰寫 PEP 與實作"
#: ../../whatsnew/3.7.rst:572
msgid "dataclasses"
msgstr "dataclasses"
#: ../../whatsnew/3.7.rst:574
msgid ""
"The new :func:`~dataclasses.dataclass` decorator provides a way to declare "
"*data classes*. A data class describes its attributes using class variable "
"annotations. Its constructor and other magic methods, such as :meth:"
"`~object.__repr__`, :meth:`~object.__eq__`, and :meth:`~object.__hash__` are "
"generated automatically."
msgstr ""
#: ../../whatsnew/3.7.rst:580
msgid "Example::"
msgstr "範例: ::"
#: ../../whatsnew/3.7.rst:582
msgid ""
"@dataclass\n"
"class Point:\n"
" x: float\n"
" y: float\n"
" z: float = 0.0\n"
"\n"
"p = Point(1.5, 2.5)\n"
"print(p) # produces \"Point(x=1.5, y=2.5, z=0.0)\""
msgstr ""
#: ../../whatsnew/3.7.rst:593
msgid ":pep:`557` -- Data Classes"
msgstr ""
#: ../../whatsnew/3.7.rst:594
msgid "PEP written and implemented by Eric V. Smith"
msgstr "由 Eric V. Smith 撰寫 PEP 與實作"
#: ../../whatsnew/3.7.rst:600
msgid "importlib.resources"
msgstr "importlib.resources"
#: ../../whatsnew/3.7.rst:602
msgid ""
"The new :mod:`importlib.resources` module provides several new APIs and one "
"new ABC for access to, opening, and reading *resources* inside packages. "
"Resources are roughly similar to files inside packages, but they needn't be "
"actual files on the physical file system. Module loaders can provide a :"
"meth:`get_resource_reader` function which returns a :class:`importlib.abc."
"ResourceReader` instance to support this new API. Built-in file path "
"loaders and zip file loaders both support this."
msgstr ""
#: ../../whatsnew/3.7.rst:610
msgid "Contributed by Barry Warsaw and Brett Cannon in :issue:`32248`."
msgstr "由 Barry Warsaw 與 Brett Cannon 在 :issue:`32248` 中貢獻。"
#: ../../whatsnew/3.7.rst:614
msgid ""
"`importlib_resources <https://importlib-resources.readthedocs.io/en/latest/"
">`_ -- a PyPI backport for earlier Python versions."
msgstr ""
#: ../../whatsnew/3.7.rst:619
msgid "Improved Modules"
msgstr "改進的模組"
#: ../../whatsnew/3.7.rst:623
msgid "argparse"
msgstr "argparse"
#: ../../whatsnew/3.7.rst:625
msgid ""
"The new :meth:`ArgumentParser.parse_intermixed_args() <argparse."
"ArgumentParser.parse_intermixed_args>` method allows intermixing options and "
"positional arguments. (Contributed by paul.j3 in :issue:`14191`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:634 ../../whatsnew/3.7.rst:1964
msgid "asyncio"
msgstr "asyncio"
#: ../../whatsnew/3.7.rst:636
msgid ""
"The :mod:`asyncio` module has received many new features, usability and :ref:"
"`performance improvements <whatsnew37-asyncio-perf>`. Notable changes "
"include:"
msgstr ""
#: ../../whatsnew/3.7.rst:640
msgid ""
"The new :term:`provisional <provisional API>` :func:`asyncio.run` function "
"can be used to run a coroutine from synchronous code by automatically "
"creating and destroying the event loop. (Contributed by Yury Selivanov in :"
"issue:`32314`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:645
msgid ""
"asyncio gained support for :mod:`contextvars`. :meth:`loop.call_soon() "
"<asyncio.loop.call_soon>`, :meth:`loop.call_soon_threadsafe() <asyncio.loop."
"call_soon_threadsafe>`, :meth:`loop.call_later() <asyncio.loop."
"call_later>`, :meth:`loop.call_at() <asyncio.loop.call_at>`, and :meth:"
"`Future.add_done_callback() <asyncio.Future.add_done_callback>` have a new "
"optional keyword-only *context* parameter. :class:`Tasks <asyncio.Task>` now "
"track their context automatically. See :pep:`567` for more details. "
"(Contributed by Yury Selivanov in :issue:`32436`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:656
msgid ""
"The new :func:`asyncio.create_task` function has been added as a shortcut to "
"``asyncio.get_event_loop().create_task()``. (Contributed by Andrew Svetlov "
"in :issue:`32311`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:660
msgid ""
"The new :meth:`loop.start_tls() <asyncio.loop.start_tls>` method can be used "
"to upgrade an existing connection to TLS. (Contributed by Yury Selivanov in :"
"issue:`23749`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:664
msgid ""
"The new :meth:`loop.sock_recv_into() <asyncio.loop.sock_recv_into>` method "
"allows reading data from a socket directly into a provided buffer making it "
"possible to reduce data copies. (Contributed by Antoine Pitrou in :issue:"
"`31819`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:669
msgid ""
"The new :func:`asyncio.current_task` function returns the currently running :"
"class:`~asyncio.Task` instance, and the new :func:`asyncio.all_tasks` "
"function returns a set of all existing ``Task`` instances in a given loop. "
"The :meth:`!Task.current_task` and :meth:`!Task.all_tasks` methods have been "
"deprecated. (Contributed by Andrew Svetlov in :issue:`32250`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:676
msgid ""
"The new *provisional* :class:`~asyncio.BufferedProtocol` class allows "
"implementing streaming protocols with manual control over the receive "
"buffer. (Contributed by Yury Selivanov in :issue:`32251`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:680
msgid ""
"The new :func:`asyncio.get_running_loop` function returns the currently "
"running loop, and raises a :exc:`RuntimeError` if no loop is running. This "
"is in contrast with :func:`asyncio.get_event_loop`, which will *create* a "
"new event loop if none is running. (Contributed by Yury Selivanov in :issue:"
"`32269`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:686
msgid ""
"The new :meth:`StreamWriter.wait_closed() <asyncio.StreamWriter."
"wait_closed>` coroutine method allows waiting until the stream writer is "
"closed. The new :meth:`StreamWriter.is_closing() <asyncio.StreamWriter."
"is_closing>` method can be used to determine if the writer is closing. "
"(Contributed by Andrew Svetlov in :issue:`32391`.)"
msgstr ""
#: ../../whatsnew/3.7.rst:692
msgid ""
"The new :meth:`loop.sock_sendfile() <asyncio.loop.sock_sendfile>` coroutine "
"method allows sending files using :mod:`os.sendfile` when possible. "
"(Contributed by Andrew Svetlov in :issue:`32410`.)"
msgstr ""