-
-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy path3.11.po
5541 lines (4765 loc) · 222 KB
/
3.11.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-2023, Python Software Foundation
# This file is distributed under the same license as the Python package.
# Translators:
# Matt Wang <[email protected]>, 2022-2023
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-23 07:52+0800\n"
"PO-Revision-Date: 2023-05-28 18:21+0800\n"
"Last-Translator: Matt Wang <[email protected]>\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"
"X-Generator: Poedit 3.2.2\n"
#: ../../whatsnew/3.11.rst:3
msgid "What's New In Python 3.11"
msgstr "Python 3.11 有什麼新功能"
#: ../../whatsnew/3.11.rst:0
msgid "Editor"
msgstr "編輯者"
#: ../../whatsnew/3.11.rst:5
msgid "Pablo Galindo Salgado"
msgstr "Pablo Galindo Salgado"
#: ../../whatsnew/3.11.rst:47
msgid ""
"This article explains the new features in Python 3.11, compared to 3.10. "
"Python 3.11 was released on October 24, 2022. For full details, see the :ref:"
"`changelog <changelog>`."
msgstr ""
"此文章解釋了 Python 3.11 和 3.10 相比多了哪些新功能。Python 3.11 於 2022 年 "
"10 月 24 日發布。完整細節請見 :ref:`changelog`。"
#: ../../whatsnew/3.11.rst:55
msgid "Summary -- Release highlights"
msgstr "發布重點摘要"
#: ../../whatsnew/3.11.rst:60
msgid ""
"Python 3.11 is between 10-60% faster than Python 3.10. On average, we "
"measured a 1.25x speedup on the standard benchmark suite. See :ref:"
"`whatsnew311-faster-cpython` for details."
msgstr ""
"Python 3.11 比 Python 3.10 快了 10-60%。我們使用了標準基準量測套裝軟體 "
"(benchmark suite) 測得平均加速了 1.25x。細節請見\\ :ref:`whatsnew311-faster-"
"cpython`。"
#: ../../whatsnew/3.11.rst:66
msgid "New syntax features:"
msgstr "新增語法特性:"
#: ../../whatsnew/3.11.rst:68
msgid ":ref:`whatsnew311-pep654`"
msgstr ":ref:`whatsnew311-pep654`"
#: ../../whatsnew/3.11.rst:70
msgid "New built-in features:"
msgstr "新的內建功能:"
#: ../../whatsnew/3.11.rst:72
msgid ":ref:`whatsnew311-pep678`"
msgstr ":ref:`whatsnew311-pep678`"
#: ../../whatsnew/3.11.rst:74
msgid "New standard library modules:"
msgstr "新增標準函式庫模組:"
#: ../../whatsnew/3.11.rst:76
msgid ""
":pep:`680`: :mod:`tomllib` — Support for parsing `TOML <https://toml.io/>`_ "
"in the Standard Library"
msgstr ""
":pep:`680`::mod:`tomllib` — 在標準函式庫中支援 `TOML <https://toml.io/>`_ 檔"
"案的剖析"
#: ../../whatsnew/3.11.rst:79
msgid "Interpreter improvements:"
msgstr "直譯器的改進:"
#: ../../whatsnew/3.11.rst:81
msgid ":ref:`whatsnew311-pep657`"
msgstr ":ref:`whatsnew311-pep657`"
#: ../../whatsnew/3.11.rst:82
msgid ""
"New :option:`-P` command line option and :envvar:`PYTHONSAFEPATH` "
"environment variable to :ref:`disable automatically prepending potentially "
"unsafe paths <whatsnew311-pythonsafepath>` to :data:`sys.path`"
msgstr ""
"新增 :option:`-P` 命令列選項和 :envvar:`PYTHONSAFEPATH` 環境變數以停用自動"
"於 :data:`sys.path` 的開頭\\ :ref:`加上一個有潛在安全問題的路徑 <whatsnew311-"
"pythonsafepath>`"
#: ../../whatsnew/3.11.rst:86
msgid "New typing features:"
msgstr "新增型別特性:"
#: ../../whatsnew/3.11.rst:88
msgid ":ref:`whatsnew311-pep646`"
msgstr ":ref:`whatsnew311-pep646`"
#: ../../whatsnew/3.11.rst:89
msgid ":ref:`whatsnew311-pep655`"
msgstr ":ref:`whatsnew311-pep655`"
#: ../../whatsnew/3.11.rst:90
msgid ":ref:`whatsnew311-pep673`"
msgstr ":ref:`whatsnew311-pep673`"
#: ../../whatsnew/3.11.rst:91
msgid ":ref:`whatsnew311-pep675`"
msgstr ":ref:`whatsnew311-pep675`"
#: ../../whatsnew/3.11.rst:92
msgid ":ref:`whatsnew311-pep681`"
msgstr ":ref:`whatsnew311-pep681`"
#: ../../whatsnew/3.11.rst:94
msgid "Important deprecations, removals and restrictions:"
msgstr "重要的棄用、移除與限制:"
#: ../../whatsnew/3.11.rst:96
msgid ""
":pep:`594`: :ref:`Many legacy standard library modules have been deprecated "
"<whatsnew311-pep594>` and will be removed in Python 3.13"
msgstr ""
":pep:`594`::ref:`許多標準函式庫中的遺留模組已被棄用 <whatsnew311-pep594>`\\ "
"且將於 Python 3.13 移除"
#: ../../whatsnew/3.11.rst:99
msgid ""
":pep:`624`: :ref:`Py_UNICODE encoder APIs have been removed <whatsnew311-"
"pep624>`"
msgstr ":pep:`624`::ref:`Py_UNICODE 編碼器 API 已被移除 <whatsnew311-pep624>`"
#: ../../whatsnew/3.11.rst:101
msgid ""
":pep:`670`: :ref:`Macros converted to static inline functions <whatsnew311-"
"pep670>`"
msgstr ":pep:`670`::ref:`轉換為靜態行內函式的巨集 <whatsnew311-pep670>`"
#: ../../whatsnew/3.11.rst:108 ../../whatsnew/3.11.rst:2211
msgid "New Features"
msgstr "新增功能"
#: ../../whatsnew/3.11.rst:113
msgid "PEP 657: Fine-grained error locations in tracebacks"
msgstr "PEP 657:回溯 (traceback) 中更細緻的錯誤位置"
#: ../../whatsnew/3.11.rst:115
msgid ""
"When printing tracebacks, the interpreter will now point to the exact "
"expression that caused the error, instead of just the line. For example:"
msgstr ""
"當要印出回溯,直譯器現在會指出造成錯誤的確切運算式,而非只說明是哪一行。例"
"如:"
#: ../../whatsnew/3.11.rst:118
msgid ""
"Traceback (most recent call last):\n"
" File \"distance.py\", line 11, in <module>\n"
" print(manhattan_distance(p1, p2))\n"
" ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
" File \"distance.py\", line 6, in manhattan_distance\n"
" return abs(point_1.x - point_2.x) + abs(point_1.y - point_2.y)\n"
" ^^^^^^^^^\n"
"AttributeError: 'NoneType' object has no attribute 'x'"
msgstr ""
"Traceback (most recent call last):\n"
" File \"distance.py\", line 11, in <module>\n"
" print(manhattan_distance(p1, p2))\n"
" ^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
" File \"distance.py\", line 6, in manhattan_distance\n"
" return abs(point_1.x - point_2.x) + abs(point_1.y - point_2.y)\n"
" ^^^^^^^^^\n"
"AttributeError: 'NoneType' object has no attribute 'x'"
#: ../../whatsnew/3.11.rst:129
msgid ""
"Previous versions of the interpreter would point to just the line, making it "
"ambiguous which object was ``None``. These enhanced errors can also be "
"helpful when dealing with deeply nested :class:`dict` objects and multiple "
"function calls:"
msgstr ""
"前一版本的直譯器只會標明是哪一行,無法辨認哪一個物件是 ``None``。當處理多層的"
"巢狀 :class:`dict` 物件和多個函式呼叫時,這種強化錯誤提示也可能非常有用:"
#: ../../whatsnew/3.11.rst:133
msgid ""
"Traceback (most recent call last):\n"
" File \"query.py\", line 37, in <module>\n"
" magic_arithmetic('foo')\n"
" File \"query.py\", line 18, in magic_arithmetic\n"
" return add_counts(x) / 25\n"
" ^^^^^^^^^^^^^\n"
" File \"query.py\", line 24, in add_counts\n"
" return 25 + query_user(user1) + query_user(user2)\n"
" ^^^^^^^^^^^^^^^^^\n"
" File \"query.py\", line 32, in query_user\n"
" return 1 + query_count(db, response['a']['b']['c']['user'], retry=True)\n"
" ~~~~~~~~~~~~~~~~~~^^^^^\n"
"TypeError: 'NoneType' object is not subscriptable"
msgstr ""
"Traceback (most recent call last):\n"
" File \"query.py\", line 37, in <module>\n"
" magic_arithmetic('foo')\n"
" File \"query.py\", line 18, in magic_arithmetic\n"
" return add_counts(x) / 25\n"
" ^^^^^^^^^^^^^\n"
" File \"query.py\", line 24, in add_counts\n"
" return 25 + query_user(user1) + query_user(user2)\n"
" ^^^^^^^^^^^^^^^^^\n"
" File \"query.py\", line 32, in query_user\n"
" return 1 + query_count(db, response['a']['b']['c']['user'], retry=True)\n"
" ~~~~~~~~~~~~~~~~~~^^^^^\n"
"TypeError: 'NoneType' object is not subscriptable"
#: ../../whatsnew/3.11.rst:149
msgid "As well as complex arithmetic expressions:"
msgstr "在複雜的計算運算式中也是:"
#: ../../whatsnew/3.11.rst:151
msgid ""
"Traceback (most recent call last):\n"
" File \"calculation.py\", line 54, in <module>\n"
" result = (x / y / z) * (a / b / c)\n"
" ~~~~~~^~~\n"
"ZeroDivisionError: division by zero"
msgstr ""
"Traceback (most recent call last):\n"
" File \"calculation.py\", line 54, in <module>\n"
" result = (x / y / z) * (a / b / c)\n"
" ~~~~~~^~~\n"
"ZeroDivisionError: division by zero"
#: ../../whatsnew/3.11.rst:159
msgid ""
"Additionally, the information used by the enhanced traceback feature is made "
"available via a general API, that can be used to correlate :term:`bytecode` :"
"ref:`instructions <bytecodes>` with source code location. This information "
"can be retrieved using:"
msgstr ""
"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來使 :term:"
"`bytecode` :ref:`指示 (instruction) <bytecodes>`\\ 與原始碼位置相互關聯。此項"
"資訊可以用以下方式取得:"
#: ../../whatsnew/3.11.rst:164
msgid "The :meth:`codeobject.co_positions` method in Python."
msgstr "Python 中的 :meth:`codeobject.co_positions` 方法。"
#: ../../whatsnew/3.11.rst:165
msgid "The :c:func:`PyCode_Addr2Location` function in the C API."
msgstr "C API 中的 :c:func:`PyCode_Addr2Location` 函式。"
#: ../../whatsnew/3.11.rst:167
msgid ""
"See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan "
"Taskaya and Ammar Askar in :issue:`43950`.)"
msgstr ""
"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar 於 :"
"issue:`43950` 中所貢獻。)"
#: ../../whatsnew/3.11.rst:171
msgid ""
"This feature requires storing column positions in :ref:`codeobjects`, which "
"may result in a small increase in interpreter memory usage and disk usage "
"for compiled Python files. To avoid storing the extra information and "
"deactivate printing the extra traceback information, use the :option:`-X "
"no_debug_ranges <-X>` command line option or the :envvar:"
"`PYTHONNODEBUGRANGES` environment variable."
msgstr ""
"這個特性必須要將欄的位置 (column position) 儲存於 :ref:`codeobjects`,這可能"
"會導致直譯器用於編譯 Python 檔案的記憶體使用量與硬碟使用量增加。為了避免儲存"
"多餘的資訊且停用印出多餘的回溯資訊,請用 :option:`-X no_debug_ranges <-X>` 命"
"令列選項或是 :envvar:`PYTHONNODEBUGRANGES` 環境變數。"
#: ../../whatsnew/3.11.rst:183
msgid "PEP 654: Exception Groups and ``except*``"
msgstr "PEP 654:例外群組與 ``except*``"
#: ../../whatsnew/3.11.rst:185
msgid ""
":pep:`654` introduces language features that enable a program to raise and "
"handle multiple unrelated exceptions simultaneously. The builtin types :exc:"
"`ExceptionGroup` and :exc:`BaseExceptionGroup` make it possible to group "
"exceptions and raise them together, and the new :keyword:`except* "
"<except_star>` syntax generalizes :keyword:`except` to match subgroups of "
"exception groups."
msgstr ""
":pep:`654` 引入了新的的語言特性,可讓程式同時引發並處理多個相互無關的例外。內"
"建型別 :exc:`ExceptionGroup` 和 :exc:`BaseExceptionGroup` 使得程式可為多個例"
"外組成群組並同時引發,新的 :keyword:`except* <except_star>` 語法也將 :"
"keyword:`except` 泛用化、能夠比對例外群組的子群組。"
#: ../../whatsnew/3.11.rst:192
msgid "See :pep:`654` for more details."
msgstr "詳情請見 :pep:`654`。"
#: ../../whatsnew/3.11.rst:194
msgid ""
"(Contributed by Irit Katriel in :issue:`45292`. PEP written by Irit Katriel, "
"Yury Selivanov and Guido van Rossum.)"
msgstr ""
"(由 Irit Katriel 於 :issue:`45292` 中所貢獻。PEP 由 Irit Katriel、Yury "
"Selivanov 與 Guido van Rossum 撰寫。)"
#: ../../whatsnew/3.11.rst:201
msgid "PEP 678: Exceptions can be enriched with notes"
msgstr "PEP 678:運用例外註解使其更加詳盡"
#: ../../whatsnew/3.11.rst:203
msgid ""
"The :meth:`~BaseException.add_note` method is added to :exc:`BaseException`. "
"It can be used to enrich exceptions with context information that is not "
"available at the time when the exception is raised. The added notes appear "
"in the default traceback."
msgstr ""
"新增 :meth:`~BaseException.add_note` 方法到 :exc:`BaseException`。當上下文資"
"訊在例外被引發時無法被取得,這個方法就可以用來為例外添加更多資訊。被添加的註"
"解會在預設回溯中出現。"
#: ../../whatsnew/3.11.rst:208
msgid "See :pep:`678` for more details."
msgstr "詳情請見 :pep:`678`。"
#: ../../whatsnew/3.11.rst:210
msgid ""
"(Contributed by Irit Katriel in :issue:`45607`. PEP written by Zac Hatfield-"
"Dodds.)"
msgstr ""
"(由 Irit Katriel 於 :issue:`45607` 中所貢獻。PEP 由 Zac Hatfield-Dodds 所撰"
"寫)"
#: ../../whatsnew/3.11.rst:217
msgid "Windows ``py.exe`` launcher improvements"
msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進"
#: ../../whatsnew/3.11.rst:219
msgid ""
"The copy of the :ref:`launcher` included with Python 3.11 has been "
"significantly updated. It now supports company/tag syntax as defined in :pep:"
"`514` using the :samp:`-V:{<company>}/{<tag>}` argument instead of the "
"limited :samp:`-{<major>}.{<minor>}`. This allows launching distributions "
"other than ``PythonCore``, the one hosted on `python.org <https://www.python."
"org>`_."
msgstr ""
"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:"
"`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{<company>}/{<tag>}` 引數"
"來取代受限的 :samp:`-{<major>}.{<minor>}`。這允許了 `python.org <https://www."
"python.org>`_ 上的 ``PythonCore`` 以外的發行版本發布。"
#: ../../whatsnew/3.11.rst:225
msgid ""
"When using ``-V:`` selectors, either company or tag can be omitted, but all "
"installs will be searched. For example, ``-V:OtherPython/`` will select the "
"\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-"
"V:/3.11`` will select the \"best\" distribution with tag ``3.11``."
msgstr ""
"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜索所有安裝。例如,``-V:"
"OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` 或 "
"``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。"
#: ../../whatsnew/3.11.rst:230
msgid ""
"When using the legacy :samp:`-{<major>}`, :samp:`-{<major>}.{<minor>}`, :"
"samp:`-{<major>}-{<bitness>}` or :samp:`-{<major>}.{<minor>}-{<bitness>}` "
"arguments, all existing behaviour should be preserved from past versions, "
"and only releases from ``PythonCore`` will be selected. However, the ``-64`` "
"suffix now implies \"not 32-bit\" (not necessarily x86-64), as there are "
"multiple supported 64-bit platforms. 32-bit runtimes are detected by "
"checking the runtime's tag for a ``-32`` suffix. All releases of Python "
"since 3.5 have included this in their 32-bit builds."
msgstr ""
"當使用遺留的 :samp:`-{<major>}`、:samp:`-{<major>}.{<minor>}`、:samp:`-"
"{<major>}-{<bitness>}` 或 :samp:`-{<major>}.{<minor>}-{<bitness>}` 引數時,所"
"有過去版本的行為都應該保留下來,且只有 ``PythonCore`` 中的發布版本會被選用。"
"然而,``-64`` 後綴現在暗示了「非 32-bit」(不用一定要是 x86-64),因為現在有"
"多個支援 64-bit 的平台。32-bit 運行程式會在檢查運行程式之標籤是否帶有 "
"``-32`` 後綴時被偵測出來。所有 Python 3.5 以後發布版本的 32-bit 建置中都有這"
"個行為。"
#: ../../whatsnew/3.11.rst:244
msgid "New Features Related to Type Hints"
msgstr "型別提示相關的新特性"
#: ../../whatsnew/3.11.rst:246
msgid ""
"This section covers major changes affecting :pep:`484` type hints and the :"
"mod:`typing` module."
msgstr ""
"這個部分涵蓋影響 :pep:`484` 型別提示 (type hints) 與 :mod:`typing` 模組的重大"
"變更。"
#: ../../whatsnew/3.11.rst:253
msgid "PEP 646: Variadic generics"
msgstr "PEP 646:可變參數泛型 (variadic generics)"
#: ../../whatsnew/3.11.rst:255
msgid ""
":pep:`484` previously introduced :data:`~typing.TypeVar`, enabling creation "
"of generics parameterised with a single type. :pep:`646` adds :data:`~typing."
"TypeVarTuple`, enabling parameterisation with an *arbitrary* number of "
"types. In other words, a :data:`~typing.TypeVarTuple` is a *variadic* type "
"variable, enabling *variadic* generics."
msgstr ""
":pep:`484` 先前引入了 :data:`~typing.TypeVar`,開啟了帶有單一型別的泛型參數"
"化。:pep:`646` 新增 :data:`~typing.TypeVarTuple`,開啟了帶有\\ *任意*\\ 數量"
"型別的參數化 (parameterisation)。換句話說,:data:`~typing.TypeVarTuple` 是\\ "
"*可變的*\\ 型別變數,啟用了\\ *可變的*\\ 泛型。"
#: ../../whatsnew/3.11.rst:262
msgid ""
"This enables a wide variety of use cases. In particular, it allows the type "
"of array-like structures in numerical computing libraries such as NumPy and "
"TensorFlow to be parameterised with the array *shape*. Static type checkers "
"will now be able to catch shape-related bugs in code that uses these "
"libraries."
msgstr ""
"這使其有非常多用例,特別是它允許了像是 NumPy 和 Tensorflow 的數值運算函式庫中"
"類似陣列結構的型別可用 *shape* 陣列來被參數化。靜態型別檢查工具現在也能夠為使"
"用這些函式庫的程式捕捉到維度相關的錯誤。"
#: ../../whatsnew/3.11.rst:268
msgid "See :pep:`646` for more details."
msgstr "詳情請見 :pep:`646`。"
#: ../../whatsnew/3.11.rst:270
msgid ""
"(Contributed by Matthew Rahtz in :issue:`43224`, with contributions by "
"Serhiy Storchaka and Jelle Zijlstra. PEP written by Mark Mendoza, Matthew "
"Rahtz, Pradeep Kumar Srinivasan, and Vincent Siles.)"
msgstr ""
"(由 Matthew Rahtz 於 :issue:`43224` 中所貢獻,由 Serhiy Storchaka 與 Jelle "
"Zijlstra 協助。PEP 由 Mark Mendoza、Matthew Rahtz、Pradeep Kumar Srinivasan "
"與 Vincent Siles 所撰寫)"
#: ../../whatsnew/3.11.rst:278
msgid ""
"PEP 655: Marking individual ``TypedDict`` items as required or not-required"
msgstr "PEP 655:標記獨立 ``TypedDict`` 項目為必要或不必要"
#: ../../whatsnew/3.11.rst:280
msgid ""
":data:`~typing.Required` and :data:`~typing.NotRequired` provide a "
"straightforward way to mark whether individual items in a :class:`~typing."
"TypedDict` must be present. Previously, this was only possible using "
"inheritance."
msgstr ""
":data:`~typing.Required` 與 :data:`~typing.NotRequired` 提供了標記一個獨立項"
"目在 :class:`~typing.TypedDict` 中是否必須存在的直覺方法。在這之前,這只有透"
"過繼承才有可能做得到。"
#: ../../whatsnew/3.11.rst:285
msgid ""
"All fields are still required by default, unless the *total* parameter is "
"set to ``False``, in which case all fields are still not-required by "
"default. For example, the following specifies a :class:`!TypedDict` with one "
"required and one not-required key::"
msgstr ""
"所有欄位都預設為是必要的,除非 *total* 參數有被設為 ``False``,那麼所有欄位就"
"會是非必要的。例如,這個範例指定了要有一個必要鍵與一個非必要鍵的 :class:`!"
"TypedDict`:"
#: ../../whatsnew/3.11.rst:291
msgid ""
"class Movie(TypedDict):\n"
" title: str\n"
" year: NotRequired[int]\n"
"\n"
"m1: Movie = {\"title\": \"Black Panther\", \"year\": 2018} # OK\n"
"m2: Movie = {\"title\": \"Star Wars\"} # OK (year is not required)\n"
"m3: Movie = {\"year\": 2022} # ERROR (missing required field title)"
msgstr ""
#: ../../whatsnew/3.11.rst:299
msgid "The following definition is equivalent::"
msgstr "以下定義等同於: ::"
#: ../../whatsnew/3.11.rst:301
msgid ""
"class Movie(TypedDict, total=False):\n"
" title: Required[str]\n"
" year: int"
msgstr ""
"class Movie(TypedDict, total=False):\n"
" title: Required[str]\n"
" year: int"
#: ../../whatsnew/3.11.rst:305
msgid "See :pep:`655` for more details."
msgstr "詳情請見 :pep:`655`。"
#: ../../whatsnew/3.11.rst:307
msgid ""
"(Contributed by David Foster and Jelle Zijlstra in :issue:`47087`. PEP "
"written by David Foster.)"
msgstr ""
"(由 David Foster 與 Jelle Zijlstra 於 :issue:`47087` 中所貢獻。PEP 由 David "
"Foster 所撰寫)"
#: ../../whatsnew/3.11.rst:314
msgid "PEP 673: ``Self`` type"
msgstr "PEP 673:``Self`` 型別"
#: ../../whatsnew/3.11.rst:316
msgid ""
"The new :data:`~typing.Self` annotation provides a simple and intuitive way "
"to annotate methods that return an instance of their class. This behaves the "
"same as the :class:`~typing.TypeVar`-based approach :pep:`specified in PEP "
"484 <484#annotating-instance-and-class-methods>`, but is more concise and "
"easier to follow."
msgstr ""
"新的 :data:`~typing.Self` 標註提供了一種簡單直觀的方法來標註那些會回傳其類別"
"實例的方法。這與 :pep:`PEP 484 <484#annotating-instance-and-class-methods>` "
"中指定的基於 :class:`~typing.TypeVar` 的方法相同,但更簡潔且更易於遵循。"
#: ../../whatsnew/3.11.rst:322
msgid ""
"Common use cases include alternative constructors provided as :func:"
"`classmethod <classmethod>`\\s, and :meth:`~object.__enter__` methods that "
"return ``self``::"
msgstr ""
"常見用例包括作為 :func:`classmethod <classmethod>` 的替代建構函式和會回傳 "
"``self`` 的 :meth:`~object.__enter__` 方法: ::"
#: ../../whatsnew/3.11.rst:326
msgid ""
"class MyLock:\n"
" def __enter__(self) -> Self:\n"
" self.lock()\n"
" return self\n"
"\n"
" ...\n"
"\n"
"class MyInt:\n"
" @classmethod\n"
" def fromhex(cls, s: str) -> Self:\n"
" return cls(int(s, 16))\n"
"\n"
" ..."
msgstr ""
"class MyLock:\n"
" def __enter__(self) -> Self:\n"
" self.lock()\n"
" return self\n"
"\n"
" ...\n"
"\n"
"class MyInt:\n"
" @classmethod\n"
" def fromhex(cls, s: str) -> Self:\n"
" return cls(int(s, 16))\n"
"\n"
" ..."
#: ../../whatsnew/3.11.rst:340
msgid ""
":data:`~typing.Self` can also be used to annotate method parameters or "
"attributes of the same type as their enclosing class."
msgstr ""
":data:`~typing.Self` 也可用於標註與其封閉類類別 (enclosing class) 相同的方法"
"參數或屬性。"
#: ../../whatsnew/3.11.rst:343
msgid "See :pep:`673` for more details."
msgstr "詳情請見 :pep:`673`。"
#: ../../whatsnew/3.11.rst:345
msgid ""
"(Contributed by James Hilton-Balfe in :issue:`46534`. PEP written by Pradeep "
"Kumar Srinivasan and James Hilton-Balfe.)"
msgstr ""
"(由 James Hilton-Balfe 於 :issue:`46534` 中所貢獻。PEP 由 Pradeep Kumar "
"Srinivasan 與 James Hilton-Balfe 所撰寫)"
#: ../../whatsnew/3.11.rst:352
msgid "PEP 675: Arbitrary literal string type"
msgstr "PEP 675:任意的文本字串型別 (Arbitrary literal string type)"
#: ../../whatsnew/3.11.rst:354
msgid ""
"The new :data:`~typing.LiteralString` annotation may be used to indicate "
"that a function parameter can be of any literal string type. This allows a "
"function to accept arbitrary literal string types, as well as strings "
"created from other literal strings. Type checkers can then enforce that "
"sensitive functions, such as those that execute SQL statements or shell "
"commands, are called only with static arguments, providing protection "
"against injection attacks."
msgstr ""
"新的 :data:`~typing.LiteralString` 標註可用於標示一個函式參數可為任何文本字串"
"型別 (literal string type)。這允許函式接受任意的文本字串型別,以及從其他文本"
"字串建立的字串。型別檢查器就可以強制需審慎處理的函式(例如會執行 SQL 陳述式"
"或 shell 命令的函式)僅會以靜態引數呼叫,從而提供針對注入攻擊的保護。"
#: ../../whatsnew/3.11.rst:362
msgid "For example, a SQL query function could be annotated as follows::"
msgstr "例如一個 SQL 查詢函式 (query function) 可以被標註為: ::"
#: ../../whatsnew/3.11.rst:364
msgid ""
"def run_query(sql: LiteralString) -> ...\n"
" ...\n"
"\n"
"def caller(\n"
" arbitrary_string: str,\n"
" query_string: LiteralString,\n"
" table_name: LiteralString,\n"
") -> None:\n"
" run_query(\"SELECT * FROM students\") # ok\n"
" run_query(query_string) # ok\n"
" run_query(\"SELECT * FROM \" + table_name) # ok\n"
" run_query(arbitrary_string) # type checker error\n"
" run_query( # type checker error\n"
" f\"SELECT * FROM students WHERE name = {arbitrary_string}\"\n"
" )"
msgstr ""
#: ../../whatsnew/3.11.rst:380
msgid "See :pep:`675` for more details."
msgstr "詳情請見 :pep:`675`。"
#: ../../whatsnew/3.11.rst:382
msgid ""
"(Contributed by Jelle Zijlstra in :issue:`47088`. PEP written by Pradeep "
"Kumar Srinivasan and Graham Bleaney.)"
msgstr ""
"(由 Jelle Zijlstra 於 :issue:`47088` 中所貢獻。PEP 由 Pradeep Kumar "
"Srinivasan 與 Graham Bleaney 所撰寫)"
#: ../../whatsnew/3.11.rst:389
msgid "PEP 681: Data class transforms"
msgstr "PEP 681:資料類別轉換 (Data class transforms)"
#: ../../whatsnew/3.11.rst:391
msgid ""
":data:`~typing.dataclass_transform` may be used to decorate a class, "
"metaclass, or a function that is itself a decorator. The presence of "
"``@dataclass_transform()`` tells a static type checker that the decorated "
"object performs runtime \"magic\" that transforms a class, giving it :func:"
"`dataclass <dataclasses.dataclass>`-like behaviors."
msgstr ""
":data:`~typing.dataclass_transform` 可以用來裝飾一個類別、元類別 "
"(metaclass)、或是一個本身就是裝飾器的函式。``@dataclass_transform()`` 的存在"
"會讓一個靜態型別檢查器知道被裝飾物件會在運行程式做出轉換類別的「魔法」,賦予"
"其類似 :func:`dataclass <dataclasses.dataclass>` 的行為。"
#: ../../whatsnew/3.11.rst:397
msgid "For example::"
msgstr "舉例來說: ::"
#: ../../whatsnew/3.11.rst:399
msgid ""
"# The create_model decorator is defined by a library.\n"
"@typing.dataclass_transform()\n"
"def create_model(cls: Type[T]) -> Type[T]:\n"
" cls.__init__ = ...\n"
" cls.__eq__ = ...\n"
" cls.__ne__ = ...\n"
" return cls\n"
"\n"
"# The create_model decorator can now be used to create new model classes:\n"
"@create_model\n"
"class CustomerModel:\n"
" id: int\n"
" name: str\n"
"\n"
"c = CustomerModel(id=327, name=\"Eric Idle\")"
msgstr ""
#: ../../whatsnew/3.11.rst:415
msgid "See :pep:`681` for more details."
msgstr "詳情請見 :pep:`681`。"
#: ../../whatsnew/3.11.rst:417
msgid ""
"(Contributed by Jelle Zijlstra in :gh:`91860`. PEP written by Erik De Bonte "
"and Eric Traut.)"
msgstr ""
"(由 Jelle Zijlstra 於 :gh:`91860` 中所貢獻。PEP 由 Erik De Bonte 與 Eric "
"Traut 所撰寫)"
#: ../../whatsnew/3.11.rst:424
msgid "PEP 563 may not be the future"
msgstr "PEP 563 可能不是未來"
#: ../../whatsnew/3.11.rst:426
msgid ""
":pep:`563` Postponed Evaluation of Annotations (the ``from __future__ import "
"annotations`` :ref:`future statement <future>`) that was originally planned "
"for release in Python 3.10 has been put on hold indefinitely. See `this "
"message from the Steering Council <https://mail.python.org/archives/list/"
"[email protected]/message/VIZEBX5EYMSYIJNDBF6DMUMZOCWHARSO/>`__ for more "
"information."
msgstr ""
":pep:`563` 標註的推遲求值 (Postponed Evaluation of Annotations)(\\ ``from "
"__future__ import annotations`` :ref:`future 陳述式 <future>`\\ )最初計劃在 "
"Python 3.10 中發布,但已被無限期擱置。請參閱\\ `來自指導委員會 (Steering "
"Counsil) 的訊息 <https://mail.python.org/archives/list/[email protected]/"
"message/VIZEBX5EYMSYIJNDBF6DMUMZOCWHARSO/>`__\\ 以獲得更多資訊。"
#: ../../whatsnew/3.11.rst:437
msgid "Other Language Changes"
msgstr "其他語言更動"
#: ../../whatsnew/3.11.rst:439
msgid ""
"Starred unpacking expressions can now be used in :keyword:`for` statements. "
"(See :issue:`46725` for more details.)"
msgstr ""
"星號拆解 (starred unpacking) 運算式現在可以在 :keyword:`for` 陳述式中使用。"
"(詳情請見 :issue:`46725`。)"
#: ../../whatsnew/3.11.rst:442
msgid ""
"Asynchronous :ref:`comprehensions <comprehensions>` are now allowed inside "
"comprehensions in :ref:`asynchronous functions <async def>`. Outer "
"comprehensions implicitly become asynchronous in this case. (Contributed by "
"Serhiy Storchaka in :issue:`33346`.)"
msgstr ""
"非同步\\ :ref:`綜合運算 (comprehension) <comprehensions>` 現在允許在\\ :ref:`"
"非同步函式中的內部綜合運算 (inside comprehension) <async def>`。在這種情況"
"下,外部綜合運算 (outer comprehension) 隱晦地變成了非同步的了。(由 Serhiy "
"Storchaka 在 :issue:`33346` 中貢獻。)"
#: ../../whatsnew/3.11.rst:447
msgid ""
"A :exc:`TypeError` is now raised instead of an :exc:`AttributeError` in :"
"keyword:`with` statements and :meth:`contextlib.ExitStack.enter_context` for "
"objects that do not support the :term:`context manager` protocol, and in :"
"keyword:`async with` statements and :meth:`contextlib.AsyncExitStack."
"enter_async_context` for objects not supporting the :term:`asynchronous "
"context manager` protocol. (Contributed by Serhiy Storchaka in :issue:"
"`12022` and :issue:`44471`.)"
msgstr ""
"現在在不支援 :term:`context manager` 協議的物件上使用 :keyword:`with` 陳述式"
"和 :meth:`contextlib.ExitStack.enter_context` 或在不支援 :term:`asynchronous "
"context manager` 協議的物件上使用 :keyword:`async with` 陳述式和 :meth:"
"`contextlib.AsyncExitStack.enter_async_context`,會引發 :exc:`TypeError` 而不"
"是 :exc:`AttributeError`。(由 Serhiy Storchaka 在 :issue:`12022` 和 :issue:"
"`44471` 中貢獻。)"
#: ../../whatsnew/3.11.rst:455
msgid ""
"Added :meth:`object.__getstate__`, which provides the default implementation "
"of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :mod:`pickle`\\ing "
"instances of subclasses of builtin types :class:`bytearray`, :class:`set`, :"
"class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections."
"deque`, :class:`weakref.WeakSet`, and :class:`datetime.tzinfo` now copies "
"and pickles instance attributes implemented as :term:`slots <__slots__>`. "
"This change has an unintended side effect: It trips up a small minority of "
"existing Python projects not expecting :meth:`object.__getstate__` to exist. "
"See the later comments on :gh:`70766` for discussions of what workarounds "
"such code may need. (Contributed by Serhiy Storchaka in :issue:`26579`.)"
msgstr ""
#: ../../whatsnew/3.11.rst:470
msgid ""
"Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` "
"environment variable, which disable the automatic prepending to :data:`sys."
"path` of the script's directory when running a script, or the current "
"directory when using :option:`-c` and :option:`-m`. This ensures only stdlib "
"and installed modules are picked up by :keyword:`import`, and avoids "
"unintentionally or maliciously shadowing modules with those in a local (and "
"typically user-writable) directory. (Contributed by Victor Stinner in :gh:"
"`57684`.)"
msgstr ""
"新增了一個 :option:`-P` 命令列選項和一個 :envvar:`PYTHONSAFEPATH` 環境變數,"
"它們禁用了當使用 :option:`-c` 和 :option:`-m` 以在運行腳本或當前目錄時自動添"
"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會被 :"
"keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入"
"的)目錄中的模組重疊。(由 Victor Stinner 在 :gh:`57684` 中貢獻。)"
#: ../../whatsnew/3.11.rst:481
msgid ""
"A ``\"z\"`` option was added to the :ref:`formatspec` that coerces negative "
"to positive zero after rounding to the format precision. See :pep:`682` for "
"more details. (Contributed by John Belmonte in :gh:`90153`.)"
msgstr ""
"``\"z\"`` 選項被新增到 :ref:`formatspec`,它會強迫負的 0 在進位到格式精度後成"
"為正的。更多詳情請見 :pep:`682`。(由 John Belmonte 於 :gh:`90153` 中貢獻。)"
#: ../../whatsnew/3.11.rst:486
msgid ""
"Bytes are no longer accepted on :data:`sys.path`. Support broke sometime "
"between Python 3.2 and 3.6, with no one noticing until after Python 3.10.0 "
"was released. In addition, bringing back support would be problematic due to "
"interactions between :option:`-b` and :data:`sys.path_importer_cache` when "
"there is a mixture of :class:`str` and :class:`bytes` keys. (Contributed by "
"Thomas Grainger in :gh:`91181`.)"
msgstr ""
":data:`sys.path` 不再接受位元組。支援已在 Python 3.2 和 3.6 之間的某個時間停"
"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使用 :class:"
"`str` 和 :class:`bytes` 鍵時 :option:`-b` 和 :data:`sys.path_importer_cache` "
"會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:"
"`91181` 中貢獻。)"
#: ../../whatsnew/3.11.rst:497
msgid "Other CPython Implementation Changes"
msgstr "其他 CPython 實作更動"
#: ../../whatsnew/3.11.rst:499
msgid ""
"The special methods :meth:`~object.__complex__` for :class:`complex` and :"
"meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :"
"class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. "
"(Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)"
msgstr ""
"為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協"
"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object."
"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Donghee Na "
"於 :issue:`24234` 中所貢獻。)"
#: ../../whatsnew/3.11.rst:504
msgid ""
"``siphash13`` is added as a new internal hashing algorithm. It has similar "
"security properties as ``siphash24``, but it is slightly faster for long "
"inputs. :class:`str`, :class:`bytes`, and some other types now use it as the "
"default algorithm for :func:`hash`. :pep:`552` :ref:`hash-based .pyc files "
"<pyc-invalidation>` now use ``siphash13`` too. (Contributed by Inada Naoki "
"in :issue:`29410`.)"
msgstr ""
"新增 ``siphash13`` 以作為內部的雜湊演算法,它有與 ``siphash24`` 相似的安全特"
"性,但是在處理較長的輸入時會更快一些。現在是 :class:`str`、:class:`bytes` 和"
"一些其他型別的 :func:`hash` 預設演算法。:pep:`552` :ref:`基於雜湊的 .pyc 檔"
"案 <pyc-invalidation>` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:"
"`29410` 中貢獻。)"
#: ../../whatsnew/3.11.rst:513
msgid ""
"When an active exception is re-raised by a :keyword:`raise` statement with "
"no parameters, the traceback attached to this exception is now always ``sys."
"exc_info()[1].__traceback__``. This means that changes made to the traceback "
"in the current :keyword:`except` clause are reflected in the re-raised "
"exception. (Contributed by Irit Katriel in :issue:`45711`.)"
msgstr ""
"當一個仍有效的例外被 :keyword:`raise` 陳述式在沒有參數的情況下重新引發,被附"
"於該例外的追蹤資訊現在都會是 ``sys.exc_info()[1].__traceback__``。這代表對於"
"當前 :keyword:`except` 子句的追蹤上做的改動會反映在被重複引發的例外上。(由 "
"Irit Katriel 於 :issue:`45711` 中貢獻。)"
#: ../../whatsnew/3.11.rst:519
msgid ""
"The interpreter state's representation of handled exceptions (aka "
"``exc_info`` or ``_PyErr_StackItem``) now only has the ``exc_value`` field; "
"``exc_type`` and ``exc_traceback`` have been removed, as they can be derived "
"from ``exc_value``. (Contributed by Irit Katriel in :issue:`45711`.)"
msgstr ""
"有被處理的例外在直譯器狀態的表示(也就是 ``exc_info`` 或 "
"``_PyErr_StackItem``)現在只會有 ``exc_value`` 欄位;``exc_type`` 和 "
"``exc_traceback`` 已被移除,現在只能透過 ``exc_value`` 來取得它們。(由 Irit "
"Katriel 於 :issue:`45711` 中貢獻。)"
#: ../../whatsnew/3.11.rst:525
msgid ""
"A new :ref:`command line option <install-quiet-option>`, ``AppendPath``, has "
"been added for the Windows installer. It behaves similarly to "
"``PrependPath``, but appends the install and scripts directories instead of "
"prepending them. (Contributed by Bastian Neuburger in :issue:`44934`.)"
msgstr ""
"新增\\ :ref:`命令列選項 <install-quiet-option>` ``AppendPath``,已增加於 "
"Windows 安裝程式。它的行為類似於 ``PrependPath``,但在安裝和腳本目錄後面附加"
"而非新增於它們前面。(由 Bastian Neuburger 在 :issue:`44934` 中貢獻。)"
#: ../../whatsnew/3.11.rst:531
msgid ""
"The :c:member:`PyConfig.module_search_paths_set` field must now be set to "
"``1`` for initialization to use :c:member:`PyConfig.module_search_paths` to "
"initialize :data:`sys.path`. Otherwise, initialization will recalculate the "
"path and replace any values added to ``module_search_paths``."
msgstr ""
"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:"
"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 "
"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。"
#: ../../whatsnew/3.11.rst:536
msgid ""
"The output of the :option:`--help` option now fits in 50 lines/80 columns. "
"Information about :ref:`Python environment variables <using-on-envvars>` "
"and :option:`-X` options is now available using the respective :option:`--"
"help-env` and :option:`--help-xoptions` flags, and with the new :option:`--"
"help-all`. (Contributed by Éric Araujo in :issue:`46142`.)"
msgstr ""
":option:`--help` 選項的輸出現在會在 50 列、80 欄的大小之內,:ref:`Python 環境"
"變數 <using-on-envvars>`\\ 和 :option:`-X` 選項的資訊現在能夠分別透過 :"
"option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` "
"一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)"
#: ../../whatsnew/3.11.rst:543
msgid ""
"Converting between :class:`int` and :class:`str` in bases other than 2 "
"(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) "
"now raises a :exc:`ValueError` if the number of digits in string form is "
"above a limit to avoid potential denial of service attacks due to the "
"algorithmic complexity. This is a mitigation for :cve:`2020-10735`. This "
"limit can be configured or disabled by environment variable, command line "
"flag, or :mod:`sys` APIs. See the :ref:`integer string conversion length "
"limitation <int_max_str_digits>` documentation. The default limit is 4300 "
"digits in string form."
msgstr ""
"在除 2(binary、二進制)、4、8(octal、八進制)、16(hexadecimal、十六進制)"
"或 32 以外的基數中,例如以 10(decimal、十進制)為基數,進行 :class:`int` "
"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引發 :exc:"
"`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial of "
"service attacks)。這是針對 :cve:`2020-10735` 的緩解措施,可以透過環境變數、命"
"令列旗標或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度"
"限制 <int_max_str_digits>` 文件。預設限制為字串形式的 4300 位數字。"
#: ../../whatsnew/3.11.rst:557
msgid "New Modules"
msgstr "新增模組"
#: ../../whatsnew/3.11.rst:559
msgid ""
":mod:`tomllib`: For parsing `TOML <https://toml.io/>`_. See :pep:`680` for "
"more details. (Contributed by Taneli Hukkinen in :issue:`40059`.)"
msgstr ""
":mod:`tomllib`:用於剖析 `TOML <https://toml.io/>`_。詳情請見 :pep:`680`。"
"(由 Taneli Hukkinen 於 :issue:`40059` 中所貢獻。)"
#: ../../whatsnew/3.11.rst:563
msgid ""
":mod:`wsgiref.types`: :pep:`WSGI <3333>`-specific types for static type "
"checking. (Contributed by Sebastian Rittau in :issue:`42012`.)"
msgstr ""
":mod:`wsgiref.types`::pep:`WSGI <3333>` 限定型別,用於靜態型別檢查。"
"(Sebastian Rittau 於 :issue:`42012` 中所貢獻。)"
#: ../../whatsnew/3.11.rst:571
msgid "Improved Modules"
msgstr "改進的模組"
#: ../../whatsnew/3.11.rst:576
msgid "asyncio"
msgstr "asyncio"
#: ../../whatsnew/3.11.rst:578
msgid ""
"Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context "
"manager <async-context-managers>` holding a group of tasks that will wait "
"for all of them upon exit. For new code this is recommended over using :func:"
"`~asyncio.create_task` and :func:`~asyncio.gather` directly. (Contributed by "
"Yury Selivanov and others in :gh:`90908`.)"
msgstr ""
"添加了 :class:`~asyncio.TaskGroup` 類別,為一個會持有任務群組並在退出時等待全"
"部完成的\\ :ref:`非同步情境管理器 (asynchronous context manager) <async-"
"context-managers>`。對於新程式碼,建議直接使用 :func:`~asyncio.create_task` "
"和 :func:`~asyncio.gather`。(由 Yury Selivanov 和其他人在 :gh:`90908` 中貢"
"獻。)"
#: ../../whatsnew/3.11.rst:585
msgid ""
"Added :func:`~asyncio.timeout`, an asynchronous context manager for setting "
"a timeout on asynchronous operations. For new code this is recommended over "
"using :func:`~asyncio.wait_for` directly. (Contributed by Andrew Svetlov in :"
"gh:`90927`.)"
msgstr ""
"新增 :func:`~asyncio.timeout`,是一個用來為一個非同步操作設置超時的非同步情境"
"管理器,新的程式建議直接使用它以取代 :func:`~asyncio.wait_for`。(由 Andrew "
"Svetlov 於 :gh:`90927` 貢獻。)"
#: ../../whatsnew/3.11.rst:590
msgid ""
"Added the :class:`~asyncio.Runner` class, which exposes the machinery used "
"by :func:`~asyncio.run`. (Contributed by Andrew Svetlov in :gh:`91218`.)"
msgstr ""
"新增 :class:`~asyncio.Runner` 類別,它會對外公布了 :func:`~asyncio.run` 的使"
"用機制。(由 Andrew Svetlov 於 :gh:`91218` 貢獻。)"
#: ../../whatsnew/3.11.rst:594
msgid ""
"Added the :class:`~asyncio.Barrier` class to the synchronization primitives "
"in the asyncio library, and the related :exc:`~asyncio.BrokenBarrierError` "
"exception. (Contributed by Yves Duprat and Andrew Svetlov in :gh:`87518`.)"
msgstr ""
"於 asyncio 函式庫的同步化原始物件中新增 :class:`~asyncio.Barrier` 類別與和其"
"相關的 :exc:`~asyncio.BrokenBarrierError` 例外。(由 Yves Duprat 和 Andrew "
"Svetlov in :gh:`87518` 貢獻。)"
#: ../../whatsnew/3.11.rst:599
msgid ""
"Added keyword argument *all_errors* to :meth:`asyncio.loop."
"create_connection` so that multiple connection errors can be raised as an :"
"exc:`ExceptionGroup`."
msgstr ""
"在 :meth:`asyncio.loop.create_connection` 新增關鍵字引數 *all_errors*,這樣多"
"個連接錯誤就可以一起用一個 :exc:`ExceptionGroup` 來引發。"
#: ../../whatsnew/3.11.rst:602
msgid ""
"Added the :meth:`asyncio.StreamWriter.start_tls` method for upgrading "
"existing stream-based connections to TLS. (Contributed by Ian Good in :issue:"
"`34975`.)"