-
-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy path3.13.po
5688 lines (4809 loc) · 206 KB
/
3.13.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-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-02-05 00:13+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\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.13.rst:4
msgid "What's New In Python 3.13"
msgstr "Python 3.13 有什麼新功能"
#: ../../whatsnew/3.13.rst:0
msgid "Editors"
msgstr "編輯者"
#: ../../whatsnew/3.13.rst:6
msgid "Adam Turner and Thomas Wouters"
msgstr "Adam Turner 和 Thomas Wouters"
#: ../../whatsnew/3.13.rst:48
msgid ""
"This article explains the new features in Python 3.13, compared to 3.12. "
"Python 3.13 was released on October 7, 2024. For full details, see "
"the :ref:`changelog <changelog>`."
msgstr ""
"本文介紹了 Python 3.13 與 3.12 相比多了哪些新功能。Python 3.13 已於 2024 年 "
"10 月 7 日發布。完整詳情請見 :ref:`changelog <changelog>`。"
#: ../../whatsnew/3.13.rst:54
msgid ":pep:`719` -- Python 3.13 Release Schedule"
msgstr ":pep:`719` -- Python 3.13 發佈時程"
#: ../../whatsnew/3.13.rst:58
msgid "Summary -- Release Highlights"
msgstr "發布重點摘要"
#: ../../whatsnew/3.13.rst:63
msgid ""
"Python 3.13 is the latest stable release of the Python programming language, "
"with a mix of changes to the language, the implementation and the standard "
"library. The biggest changes include a new `interactive interpreter "
"<whatsnew313-better-interactive-interpreter_>`_, experimental support for "
"running in a `free-threaded mode <whatsnew313-free-threaded-cpython_>`_ "
"(:pep:`703`), and a `Just-In-Time compiler <whatsnew313-jit-compiler_>`_ "
"(:pep:`744`)."
msgstr ""
#: ../../whatsnew/3.13.rst:72
msgid ""
"Error messages continue to improve, with tracebacks now highlighted in color "
"by default. The :func:`locals` builtin now has :ref:`defined semantics "
"<whatsnew313-locals-semantics>` for changing the returned mapping, and type "
"parameters now support default values."
msgstr ""
#: ../../whatsnew/3.13.rst:77
msgid ""
"The library changes contain removal of deprecated APIs and modules, as well "
"as the usual improvements in user-friendliness and correctness. Several "
"legacy standard library modules have now `been removed <whatsnew313-"
"pep594_>`_ following their deprecation in Python 3.11 (:pep:`594`)."
msgstr ""
#: ../../whatsnew/3.13.rst:82
msgid ""
"This article doesn't attempt to provide a complete specification of all new "
"features, but instead gives a convenient overview. For full details refer to "
"the documentation, such as the :ref:`Library Reference <library-index>` "
"and :ref:`Language Reference <reference-index>`. To understand the complete "
"implementation and design rationale for a change, refer to the PEP for a "
"particular new feature; but note that PEPs usually are not kept up-to-date "
"once a feature has been fully implemented. See `Porting to Python 3.13`_ for "
"guidance on upgrading from earlier versions of Python."
msgstr ""
#: ../../whatsnew/3.13.rst:98
msgid "Interpreter improvements:"
msgstr "直譯器改進:"
#: ../../whatsnew/3.13.rst:100
msgid ""
"A greatly improved :ref:`interactive interpreter <whatsnew313-better-"
"interactive-interpreter>` and :ref:`improved error messages <whatsnew313-"
"improved-error-messages>`."
msgstr ""
#: ../../whatsnew/3.13.rst:103
msgid ""
":pep:`667`: The :func:`locals` builtin now has :ref:`defined semantics "
"<whatsnew313-locals-semantics>` when mutating the returned mapping. Python "
"debuggers and similar tools may now more reliably update local variables in "
"optimized scopes even during concurrent code execution."
msgstr ""
#: ../../whatsnew/3.13.rst:108
msgid ""
":pep:`703`: CPython 3.13 has experimental support for running with "
"the :term:`global interpreter lock` disabled. See :ref:`Free-threaded "
"CPython <whatsnew313-free-threaded-cpython>` for more details."
msgstr ""
#: ../../whatsnew/3.13.rst:111
msgid ""
":pep:`744`: A basic :ref:`JIT compiler <whatsnew313-jit-compiler>` was "
"added. It is currently disabled by default (though we may turn it on later). "
"Performance improvements are modest -- we expect to improve this over the "
"next few releases."
msgstr ""
#: ../../whatsnew/3.13.rst:115
msgid ""
"Color support in the new :ref:`interactive interpreter <whatsnew313-better-"
"interactive-interpreter>`, as well as in :ref:`tracebacks <whatsnew313-"
"improved-error-messages>` and :ref:`doctest <whatsnew313-doctest>` output. "
"This can be disabled through the :envvar:`PYTHON_COLORS` and |NO_COLOR|_ "
"environment variables."
msgstr ""
#: ../../whatsnew/3.13.rst:122
msgid "Python data model improvements:"
msgstr "Python 資料模型改進:"
#: ../../whatsnew/3.13.rst:124
msgid ""
":attr:`~type.__static_attributes__` stores the names of attributes accessed "
"through ``self.X`` in any function in a class body."
msgstr ""
#: ../../whatsnew/3.13.rst:126
msgid ""
":attr:`~type.__firstlineno__` records the first line number of a class "
"definition."
msgstr ""
#: ../../whatsnew/3.13.rst:129
msgid "Significant improvements in the standard library:"
msgstr "標準函式庫中的顯著改進"
#: ../../whatsnew/3.13.rst:131
msgid ""
"Add a new :exc:`PythonFinalizationError` exception, raised when an operation "
"is blocked during :term:`finalization <interpreter shutdown>`."
msgstr ""
#: ../../whatsnew/3.13.rst:133
msgid ""
"The :mod:`argparse` module now supports deprecating command-line options, "
"positional arguments, and subcommands."
msgstr ""
#: ../../whatsnew/3.13.rst:135
msgid ""
"The new functions :func:`base64.z85encode` and :func:`base64.z85decode` "
"support encoding and decoding `Z85 data`_."
msgstr ""
#: ../../whatsnew/3.13.rst:137
msgid ""
"The :mod:`copy` module now has a :func:`copy.replace` function, with support "
"for many builtin types and any class defining "
"the :func:`~object.__replace__` method."
msgstr ""
#: ../../whatsnew/3.13.rst:140
msgid ""
"The new :mod:`dbm.sqlite3` module is now the default :mod:`dbm` backend."
msgstr "新的 :mod:`dbm.sqlite3` 模組現在是預設的 :mod:`dbm` 後端。"
#: ../../whatsnew/3.13.rst:141
msgid ""
"The :mod:`os` module has a :ref:`suite of new functions <os-timerfd>` for "
"working with Linux's timer notification file descriptors."
msgstr ""
#: ../../whatsnew/3.13.rst:143
msgid ""
"The :mod:`random` module now has a :ref:`command-line interface <random-"
"cli>`."
msgstr "現在 :mod:`random` 模組有一個\\ :ref:`命令列介面 <random-cli>`。"
#: ../../whatsnew/3.13.rst:145
msgid "Security improvements:"
msgstr "安全性改進:"
#: ../../whatsnew/3.13.rst:147
msgid ""
":func:`ssl.create_default_context` "
"sets :data:`ssl.VERIFY_X509_PARTIAL_CHAIN` "
"and :data:`ssl.VERIFY_X509_STRICT` as default flags."
msgstr ""
#: ../../whatsnew/3.13.rst:150
msgid "C API improvements:"
msgstr "C API 改進:"
#: ../../whatsnew/3.13.rst:152
msgid ""
"The :c:data:`Py_mod_gil` slot is now used to indicate that an extension "
"module supports running with the :term:`GIL` disabled."
msgstr ""
#: ../../whatsnew/3.13.rst:154
msgid ""
"The :doc:`PyTime C API </c-api/time>` has been added, providing access to "
"system clocks."
msgstr ""
#: ../../whatsnew/3.13.rst:156
msgid ""
":c:type:`PyMutex` is a new lightweight mutex that occupies a single byte."
msgstr ""
#: ../../whatsnew/3.13.rst:157
msgid ""
"There is a new :ref:`suite of functions <c-api-monitoring>` for "
"generating :pep:`669` monitoring events in the C API."
msgstr ""
#: ../../whatsnew/3.13.rst:160
msgid "New typing features:"
msgstr "新增型別特性:"
#: ../../whatsnew/3.13.rst:162
msgid ""
":pep:`696`: Type parameters "
"(:data:`typing.TypeVar`, :data:`typing.ParamSpec`, "
"and :data:`typing.TypeVarTuple`) now support defaults."
msgstr ""
#: ../../whatsnew/3.13.rst:164
msgid ""
":pep:`702`: The new :func:`warnings.deprecated` decorator adds support for "
"marking deprecations in the type system and at runtime."
msgstr ""
#: ../../whatsnew/3.13.rst:166
msgid ""
":pep:`705`: :data:`typing.ReadOnly` can be used to mark an item of "
"a :class:`typing.TypedDict` as read-only for type checkers."
msgstr ""
#: ../../whatsnew/3.13.rst:168
msgid ""
":pep:`742`: :data:`typing.TypeIs` provides more intuitive type narrowing "
"behavior, as an alternative to :data:`typing.TypeGuard`."
msgstr ""
#: ../../whatsnew/3.13.rst:171
msgid "Platform support:"
msgstr "平台支援:"
#: ../../whatsnew/3.13.rst:173
msgid ""
":pep:`730`: Apple's iOS is now an :ref:`officially supported platform "
"<whatsnew313-platform-support>`, at :pep:`tier 3 <11#tier-3>`."
msgstr ""
#: ../../whatsnew/3.13.rst:175
msgid ""
":pep:`738`: Android is now an :ref:`officially supported platform "
"<whatsnew313-platform-support>`, at :pep:`tier 3 <11#tier-3>`."
msgstr ""
#: ../../whatsnew/3.13.rst:177
msgid ""
"``wasm32-wasi`` is now supported as a :pep:`tier 2 <11#tier-2>` platform."
msgstr "``wasm32-wasi`` 現在作為 :pep:`tier 2 <11#tier-2>` 平台支援。"
#: ../../whatsnew/3.13.rst:178
msgid "``wasm32-emscripten`` is no longer an officially supported platform."
msgstr "``wasm32-emscripten`` 不再是官方支援的平台。"
#: ../../whatsnew/3.13.rst:180
msgid "Important removals:"
msgstr "重要的移除:"
#: ../../whatsnew/3.13.rst:182
msgid ""
":ref:`PEP 594 <whatsnew313-pep594>`: The remaining 19 \"dead batteries\" "
"(legacy stdlib modules) have been removed from the standard library: :mod:`!"
"aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!chunk`, :mod:`!"
"crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:`!nis`, :mod:`!"
"nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!"
"spwd`, :mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`."
msgstr ""
":ref:`PEP 594 <whatsnew313-pep594>`: 剩下的 19 個 \"dead batteries\" (遺留標"
"準函式庫模組)已自標準函式庫中移除::mod:`!aifc`、:mod:`!audioop`、:mod:`!"
"cgi`、:mod:`!cgitb`、:mod:`!chunk`、:mod:`!crypt`、:mod:`!imghdr`、:mod:`!"
"mailcap`、:mod:`!msilib`、:mod:`!nis`、:mod:`!nntplib`、:mod:`!"
"ossaudiodev`、:mod:`!pipes`、:mod:`!sndhdr`、:mod:`!spwd`、:mod:`!"
"sunau`、:mod:`!telnetlib`、:mod:`!uu` 和 :mod:`!xdrlib`."
#: ../../whatsnew/3.13.rst:188
msgid ""
"Remove the :program:`2to3` tool and :mod:`!lib2to3` module (deprecated in "
"Python 3.11)."
msgstr ""
#: ../../whatsnew/3.13.rst:190
msgid "Remove the :mod:`!tkinter.tix` module (deprecated in Python 3.6)."
msgstr "移除 :mod:`!tkinter.tix` 模組(在 Python 3.6 中已棄用)。"
#: ../../whatsnew/3.13.rst:191
msgid "Remove the :func:`!locale.resetlocale` function."
msgstr "移除 :func:`!locale.resetlocale` 函式。"
#: ../../whatsnew/3.13.rst:192
msgid "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces."
msgstr "移除 :mod:`!typing.io` 和 :mod:`!typing.re` 命名空間。"
#: ../../whatsnew/3.13.rst:193
msgid "Remove chained :class:`classmethod` descriptors."
msgstr ""
#: ../../whatsnew/3.13.rst:195
msgid "Release schedule changes:"
msgstr ""
#: ../../whatsnew/3.13.rst:197
msgid ""
":pep:`602` (\"Annual Release Cycle for Python\") has been updated to extend "
"the full support ('bugfix') period for new releases to two years. This "
"updated policy means that:"
msgstr ""
#: ../../whatsnew/3.13.rst:201
msgid ""
"Python 3.9--3.12 have one and a half years of full support, followed by "
"three and a half years of security fixes."
msgstr ""
#: ../../whatsnew/3.13.rst:203
msgid ""
"Python 3.13 and later have two years of full support, followed by three "
"years of security fixes."
msgstr ""
#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:2037
msgid "New Features"
msgstr "新增功能"
#: ../../whatsnew/3.13.rst:214
msgid "A better interactive interpreter"
msgstr ""
#: ../../whatsnew/3.13.rst:216
msgid ""
"Python now uses a new :term:`interactive` shell by default, based on code "
"from the `PyPy project`_. When the user starts the :term:`REPL` from an "
"interactive terminal, the following new features are now supported:"
msgstr ""
#: ../../whatsnew/3.13.rst:221
msgid "Multiline editing with history preservation."
msgstr ""
#: ../../whatsnew/3.13.rst:222
msgid ""
"Direct support for REPL-specific commands like :kbd:`help`, :kbd:`exit`, "
"and :kbd:`quit`, without the need to call them as functions."
msgstr ""
#: ../../whatsnew/3.13.rst:224
msgid ""
"Prompts and tracebacks with :ref:`color enabled by default <using-on-"
"controlling-color>`."
msgstr ""
#: ../../whatsnew/3.13.rst:226
msgid ""
"Interactive help browsing using :kbd:`F1` with a separate command history."
msgstr ""
#: ../../whatsnew/3.13.rst:228
msgid ""
"History browsing using :kbd:`F2` that skips output as well as "
"the :term:`>>>` and :term:`...` prompts."
msgstr ""
#: ../../whatsnew/3.13.rst:230
msgid ""
"\"Paste mode\" with :kbd:`F3` that makes pasting larger blocks of code "
"easier (press :kbd:`F3` again to return to the regular prompt)."
msgstr ""
#: ../../whatsnew/3.13.rst:233
msgid ""
"To disable the new interactive shell, set the :envvar:`PYTHON_BASIC_REPL` "
"environment variable. For more on interactive mode, see :ref:`tut-interac`."
msgstr ""
#: ../../whatsnew/3.13.rst:237
msgid ""
"(Contributed by Pablo Galindo Salgado, Łukasz Langa, and Lysandros Nikolaou "
"in :gh:`111201` based on code from the PyPy project. Windows support "
"contributed by Dino Viehland and Anthony Shaw.)"
msgstr ""
#: ../../whatsnew/3.13.rst:247
msgid "Improved error messages"
msgstr ""
#: ../../whatsnew/3.13.rst:249
msgid ""
"The interpreter now uses color by default when displaying tracebacks in the "
"terminal. This feature :ref:`can be controlled <using-on-controlling-color>` "
"via the new :envvar:`PYTHON_COLORS` environment variable as well as the "
"canonical |NO_COLOR|_ and |FORCE_COLOR|_ environment variables. (Contributed "
"by Pablo Galindo Salgado in :gh:`112730`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:264
msgid ""
"A common mistake is to write a script with the same name as a standard "
"library module. When this results in errors, we now display a more helpful "
"error message:"
msgstr ""
#: ../../whatsnew/3.13.rst:268
msgid ""
"$ python random.py\n"
"Traceback (most recent call last):\n"
" File \"/home/me/random.py\", line 1, in <module>\n"
" import random\n"
" File \"/home/me/random.py\", line 3, in <module>\n"
" print(random.randint(5))\n"
" ^^^^^^^^^^^^^^\n"
"AttributeError: module 'random' has no attribute 'randint' (consider "
"renaming '/home/me/random.py' since it has the same name as the standard "
"library module named 'random' and prevents importing that standard library "
"module)"
msgstr ""
"$ python random.py\n"
"Traceback (most recent call last):\n"
" File \"/home/me/random.py\", line 1, in <module>\n"
" import random\n"
" File \"/home/me/random.py\", line 3, in <module>\n"
" print(random.randint(5))\n"
" ^^^^^^^^^^^^^^\n"
"AttributeError: module 'random' has no attribute 'randint' (consider "
"renaming '/home/me/random.py' since it has the same name as the standard "
"library module named 'random' and prevents importing that standard library "
"module)"
#: ../../whatsnew/3.13.rst:279
msgid ""
"Similarly, if a script has the same name as a third-party module that it "
"attempts to import and this results in errors, we also display a more "
"helpful error message:"
msgstr ""
#: ../../whatsnew/3.13.rst:283
msgid ""
"$ python numpy.py\n"
"Traceback (most recent call last):\n"
" File \"/home/me/numpy.py\", line 1, in <module>\n"
" import numpy as np\n"
" File \"/home/me/numpy.py\", line 3, in <module>\n"
" np.array([1, 2, 3])\n"
" ^^^^^^^^\n"
"AttributeError: module 'numpy' has no attribute 'array' (consider renaming '/"
"home/me/numpy.py' if it has the same name as a library you intended to "
"import)"
msgstr ""
"$ python numpy.py\n"
"Traceback (most recent call last):\n"
" File \"/home/me/numpy.py\", line 1, in <module>\n"
" import numpy as np\n"
" File \"/home/me/numpy.py\", line 3, in <module>\n"
" np.array([1, 2, 3])\n"
" ^^^^^^^^\n"
"AttributeError: module 'numpy' has no attribute 'array' (consider renaming '/"
"home/me/numpy.py' if it has the same name as a library you intended to "
#: ../../whatsnew/3.13.rst:294
msgid "(Contributed by Shantanu Jain in :gh:`95754`.)"
msgstr "(由 Shantanu Jain 在 :gh:`95754` 中貢獻。)"
#: ../../whatsnew/3.13.rst:296
msgid ""
"The error message now tries to suggest the correct keyword argument when an "
"incorrect keyword argument is passed to a function."
msgstr ""
#: ../../whatsnew/3.13.rst:299
msgid ""
">>> \"Better error messages!\".split(max_split=1)\n"
"Traceback (most recent call last):\n"
" File \"<python-input-0>\", line 1, in <module>\n"
" \"Better error messages!\".split(max_split=1)\n"
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n"
"TypeError: split() got an unexpected keyword argument 'max_split'. Did you "
"mean 'maxsplit'?"
msgstr ""
">>> \"Better error messages!\".split(max_split=1)\n"
"Traceback (most recent call last):\n"
" File \"<python-input-0>\", line 1, in <module>\n"
" \"Better error messages!\".split(max_split=1)\n"
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^\n"
"TypeError: split() got an unexpected keyword argument 'max_split'. Did you "
"mean 'maxsplit'?"
#: ../../whatsnew/3.13.rst:308
msgid ""
"(Contributed by Pablo Galindo Salgado and Shantanu Jain in :gh:`107944`.)"
msgstr "(由 Pablo Galindo Salgado 和 Shantanu Jain 於 :gh:`107944` 中貢獻。)"
#: ../../whatsnew/3.13.rst:314
msgid "Free-threaded CPython"
msgstr ""
#: ../../whatsnew/3.13.rst:316
msgid ""
"CPython now has experimental support for running in a free-threaded mode, "
"with the :term:`global interpreter lock` (GIL) disabled. This is an "
"experimental feature and therefore is not enabled by default. The free-"
"threaded mode requires a different executable, usually called "
"``python3.13t`` or ``python3.13t.exe``. Pre-built binaries marked as *free-"
"threaded* can be installed as part of the official :ref:`Windows <install-"
"freethreaded-windows>` and :ref:`macOS <install-freethreaded-macos>` "
"installers, or CPython can be built from source with the :option:`--disable-"
"gil` option."
msgstr ""
#: ../../whatsnew/3.13.rst:326
msgid ""
"Free-threaded execution allows for full utilization of the available "
"processing power by running threads in parallel on available CPU cores. "
"While not all software will benefit from this automatically, programs "
"designed with threading in mind will run faster on multi-core hardware. "
"**The free-threaded mode is experimental** and work is ongoing to improve "
"it: expect some bugs and a substantial single-threaded performance hit. Free-"
"threaded builds of CPython support optionally running with the GIL enabled "
"at runtime using the environment variable :envvar:`PYTHON_GIL` or the "
"command-line option :option:`-X gil=1`."
msgstr ""
#: ../../whatsnew/3.13.rst:336
msgid ""
"To check if the current interpreter supports free-threading, :option:`python "
"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading "
"build\". The new :func:`!sys._is_gil_enabled` function can be used to check "
"whether the GIL is actually disabled in the running process."
msgstr ""
#: ../../whatsnew/3.13.rst:341
msgid ""
"C-API extension modules need to be built specifically for the free-threaded "
"build. Extensions that support running with the :term:`GIL` disabled should "
"use the :c:data:`Py_mod_gil` slot. Extensions using single-phase init should "
"use :c:func:`PyUnstable_Module_SetGIL` to indicate whether they support "
"running with the GIL disabled. Importing C extensions that don't use these "
"mechanisms will cause the GIL to be enabled, unless the GIL was explicitly "
"disabled with the :envvar:`PYTHON_GIL` environment variable or the :option:`-"
"X gil=0` option. pip 24.1 or newer is required to install packages with C "
"extensions in the free-threaded build."
msgstr ""
#: ../../whatsnew/3.13.rst:352
msgid ""
"This work was made possible thanks to many individuals and organizations, "
"including the large community of contributors to Python and third-party "
"projects to test and enable free-threading support. Notable contributors "
"include: Sam Gross, Ken Jin, Donghee Na, Itamar Oren, Matt Page, Brett "
"Simmers, Dino Viehland, Carl Meyer, Nathan Goldbaum, Ralf Gommers, Lysandros "
"Nikolaou, and many others. Many of these contributors are employed by Meta, "
"which has provided significant engineering resources to support this project."
msgstr ""
#: ../../whatsnew/3.13.rst:364
msgid ""
":pep:`703` \"Making the Global Interpreter Lock Optional in CPython\" "
"contains rationale and information surrounding this work."
msgstr ""
#: ../../whatsnew/3.13.rst:367
msgid ""
"`Porting Extension Modules to Support Free-Threading <https://py-free-"
"threading.github.io/porting/>`_: A community-maintained porting guide for "
"extension authors."
msgstr ""
#: ../../whatsnew/3.13.rst:375
msgid "An experimental just-in-time (JIT) compiler"
msgstr ""
#: ../../whatsnew/3.13.rst:377
msgid ""
"When CPython is configured and built using the :option:`!--enable-"
"experimental-jit` option, a just-in-time (JIT) compiler is added which may "
"speed up some Python programs. On Windows, use ``PCbuild/build.bat --"
"experimental-jit`` to enable the JIT or ``--experimental-jit-interpreter`` "
"to enable the Tier 2 interpreter. Build requirements and further supporting "
"information `are contained at`__ :file:`Tools/jit/README.md`."
msgstr ""
#: ../../whatsnew/3.13.rst:387
msgid ""
"The :option:`!--enable-experimental-jit` option takes these (optional) "
"values, defaulting to ``yes`` if :option:`!--enable-experimental-jit` is "
"present without the optional value."
msgstr ""
#: ../../whatsnew/3.13.rst:391
msgid "``no``: Disable the entire Tier 2 and JIT pipeline."
msgstr ""
#: ../../whatsnew/3.13.rst:392
msgid ""
"``yes``: Enable the JIT. To disable the JIT at runtime, pass the environment "
"variable ``PYTHON_JIT=0``."
msgstr ""
#: ../../whatsnew/3.13.rst:394
msgid ""
"``yes-off``: Build the JIT but disable it by default. To enable the JIT at "
"runtime, pass the environment variable ``PYTHON_JIT=1``."
msgstr ""
#: ../../whatsnew/3.13.rst:396
msgid ""
"``interpreter``: Enable the Tier 2 interpreter but disable the JIT. The "
"interpreter can be disabled by running with ``PYTHON_JIT=0``."
msgstr ""
#: ../../whatsnew/3.13.rst:399
msgid "The internal architecture is roughly as follows:"
msgstr ""
#: ../../whatsnew/3.13.rst:401
msgid ""
"We start with specialized *Tier 1 bytecode*. See :ref:`What's new in 3.11 "
"<whatsnew311-pep659>` for details."
msgstr ""
#: ../../whatsnew/3.13.rst:403
msgid ""
"When the Tier 1 bytecode gets hot enough, it gets translated to a new purely "
"internal intermediate representation (IR), called the *Tier 2 IR*, and "
"sometimes referred to as micro-ops (\"uops\")."
msgstr ""
#: ../../whatsnew/3.13.rst:406
msgid ""
"The Tier 2 IR uses the same stack-based virtual machine as Tier 1, but the "
"instruction format is better suited to translation to machine code."
msgstr ""
#: ../../whatsnew/3.13.rst:408
msgid ""
"We have several optimization passes for Tier 2 IR, which are applied before "
"it is interpreted or translated to machine code."
msgstr ""
#: ../../whatsnew/3.13.rst:410
msgid ""
"There is a Tier 2 interpreter, but it is mostly intended for debugging the "
"earlier stages of the optimization pipeline. The Tier 2 interpreter can be "
"enabled by configuring Python with ``--enable-experimental-jit=interpreter``."
msgstr ""
#: ../../whatsnew/3.13.rst:414
msgid ""
"When the JIT is enabled, the optimized Tier 2 IR is translated to machine "
"code, which is then executed."
msgstr ""
#: ../../whatsnew/3.13.rst:416
msgid ""
"The machine code translation process uses a technique called *copy-and-"
"patch*. It has no runtime dependencies, but there is a new build-time "
"dependency on LLVM."
msgstr ""
#: ../../whatsnew/3.13.rst:420
msgid ":pep:`744`"
msgstr ":pep:`744`"
#: ../../whatsnew/3.13.rst:422
msgid ""
"(JIT by Brandt Bucher, inspired by a paper by Haoran Xu and Fredrik "
"Kjolstad. Tier 2 IR by Mark Shannon and Guido van Rossum. Tier 2 optimizer "
"by Ken Jin.)"
msgstr ""
#: ../../whatsnew/3.13.rst:430
msgid "Defined mutation semantics for :py:func:`locals`"
msgstr ""
#: ../../whatsnew/3.13.rst:432
msgid ""
"Historically, the expected result of mutating the return value "
"of :func:`locals` has been left to individual Python implementations to "
"define. Starting from Python 3.13, :pep:`667` standardises the historical "
"behavior of CPython for most code execution scopes, but "
"changes :term:`optimized scopes <optimized scope>` (functions, generators, "
"coroutines, comprehensions, and generator expressions) to explicitly return "
"independent snapshots of the currently assigned local variables, including "
"locally referenced nonlocal variables captured in closures."
msgstr ""
#: ../../whatsnew/3.13.rst:441
msgid ""
"This change to the semantics of :func:`locals` in optimized scopes also "
"affects the default behavior of code execution functions that implicitly "
"target :func:`!locals` if no explicit namespace is provided (such "
"as :func:`exec` and :func:`eval`). In previous versions, whether or not "
"changes could be accessed by calling :func:`!locals` after calling the code "
"execution function was implementation-dependent. In CPython specifically, "
"such code would typically appear to work as desired, but could sometimes "
"fail in optimized scopes based on other code (including debuggers and code "
"execution tracing tools) potentially resetting the shared snapshot in that "
"scope. Now, the code will always run against an independent snapshot of the "
"local variables in optimized scopes, and hence the changes will never be "
"visible in subsequent calls to :func:`!locals`. To access the changes made "
"in these cases, an explicit namespace reference must now be passed to the "
"relevant function. Alternatively, it may make sense to update affected code "
"to use a higher level code execution API that returns the resulting code "
"execution namespace (e.g. :func:`runpy.run_path` when executing Python files "
"from disk)."
msgstr ""
#: ../../whatsnew/3.13.rst:460
msgid ""
"To ensure debuggers and similar tools can reliably update local variables in "
"scopes affected by this change, :attr:`FrameType.f_locals <frame.f_locals>` "
"now returns a write-through proxy to the frame's local and locally "
"referenced nonlocal variables in these scopes, rather than returning an "
"inconsistently updated shared ``dict`` instance with undefined runtime "
"semantics."
msgstr ""
#: ../../whatsnew/3.13.rst:466
msgid ""
"See :pep:`667` for more details, including related C API changes and "
"deprecations. Porting notes are also provided below for the "
"affected :ref:`Python APIs <pep667-porting-notes-py>` and :ref:`C APIs "
"<pep667-porting-notes-c>`."
msgstr ""
#: ../../whatsnew/3.13.rst:471
msgid ""
"(PEP and implementation contributed by Mark Shannon and Tian Gao "
"in :gh:`74929`. Documentation updates provided by Guido van Rossum and "
"Alyssa Coghlan.)"
msgstr ""
#: ../../whatsnew/3.13.rst:479
msgid "Support for mobile platforms"
msgstr ""
#: ../../whatsnew/3.13.rst:481
msgid ""
":pep:`730`: iOS is now a :pep:`11` supported platform, with the ``arm64-"
"apple-ios`` and ``arm64-apple-ios-simulator`` targets at tier 3 (iPhone and "
"iPad devices released after 2013 and the Xcode iOS simulator running on "
"Apple silicon hardware, respectively). ``x86_64-apple-ios-simulator`` (the "
"Xcode iOS simulator running on older ``x86_64`` hardware) is not a tier 3 "
"supported platform, but will have best-effort support. (PEP written and "
"implementation contributed by Russell Keith-Magee in :gh:`114099`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:491
msgid ""
":pep:`738`: Android is now a :pep:`11` supported platform, with the "
"``aarch64-linux-android`` and ``x86_64-linux-android`` targets at tier 3. "
"The 32-bit targets ``arm-linux-androideabi`` and ``i686-linux-android`` are "
"not tier 3 supported platforms, but will have best-effort support. (PEP "
"written and implementation contributed by Malcolm Smith in :gh:`116622`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:498
msgid ":pep:`730`, :pep:`738`"
msgstr ":pep:`730`、:pep:`738`"
#: ../../whatsnew/3.13.rst:502
msgid "Other Language Changes"
msgstr "其他語言更動"
#: ../../whatsnew/3.13.rst:504
msgid ""
"The compiler now strips common leading whitespace from every line in a "
"docstring. This reduces the size of the :term:`bytecode cache <bytecode>` "
"(such as ``.pyc`` files), with reductions in file size of around 5%, for "
"example in :mod:`!sqlalchemy.orm.session` from SQLAlchemy 2.0. This change "
"affects tools that use docstrings, such as :mod:`doctest`."
msgstr ""
#: ../../whatsnew/3.13.rst:511
msgid ""
">>> def spam():\n"
"... \"\"\"\n"
"... This is a docstring with\n"
"... leading whitespace.\n"
"...\n"
"... It even has multiple paragraphs!\n"
"... \"\"\"\n"
"...\n"
">>> spam.__doc__\n"
"'\\nThis is a docstring with\\n leading whitespace.\\n\\nIt even has "
"multiple paragraphs!\\n'"
msgstr ""
#: ../../whatsnew/3.13.rst:524
msgid "(Contributed by Inada Naoki in :gh:`81283`.)"
msgstr "(由 Inada Naoki 在 :gh:`81283` 中貢獻。)"
#: ../../whatsnew/3.13.rst:526
msgid ""
":ref:`Annotation scopes <annotation-scopes>` within class scopes can now "
"contain lambdas and comprehensions. Comprehensions that are located within "
"class scopes are not inlined into their parent scope."
msgstr ""
#: ../../whatsnew/3.13.rst:531
msgid ""
"class C[T]:\n"
" type Alias = lambda: T"
msgstr ""
"class C[T]:\n"
" type Alias = lambda: T"
#: ../../whatsnew/3.13.rst:536
msgid "(Contributed by Jelle Zijlstra in :gh:`109118` and :gh:`118160`.)"
msgstr "(由 Jelle Zijlstra 在 :gh:`109118` 和 :gh:`118160` 中貢獻。)"
#: ../../whatsnew/3.13.rst:538
msgid ""
":ref:`Future statements <future>` are no longer triggered by relative "
"imports of the :mod:`__future__` module, meaning that statements of the form "
"``from .__future__ import ...`` are now simply standard relative imports, "
"with no special features activated. (Contributed by Jeremiah Gabriel Pascual "
"in :gh:`118216`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:544
msgid ""
":keyword:`global` declarations are now permitted in :keyword:`except` blocks "
"when that global is used in the :keyword:`else` block. Previously this "
"raised an erroneous :exc:`SyntaxError`. (Contributed by Irit Katriel "
"in :gh:`111123`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:549
msgid ""
"Add :envvar:`PYTHON_FROZEN_MODULES`, a new environment variable that "
"determines whether frozen modules are ignored by the import machinery, "
"equivalent to the :option:`-X frozen_modules <-X>` command-line option. "
"(Contributed by Yilei Yang in :gh:`111374`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:554
msgid ""
"Add :ref:`support for the perf profiler <perf_profiling>` working without "
"`frame pointers <https://en.wikipedia.org/wiki/Call_stack>`_ through the new "
"environment variable :envvar:`PYTHON_PERF_JIT_SUPPORT` and command-line "
"option :option:`-X perf_jit <-X>`. (Contributed by Pablo Galindo "
"in :gh:`118518`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:560
msgid ""
"The location of a :file:`.python_history` file can be changed via the "
"new :envvar:`PYTHON_HISTORY` environment variable. (Contributed by Levi "
"Sabah, Zackery Spytz and Hugo van Kemenade in :gh:`73965`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:565
msgid ""
"Classes have a new :attr:`~type.__static_attributes__` attribute. This is "
"populated by the compiler with a tuple of the class's attribute names which "
"are assigned through ``self.<name>`` from any function in its body. "
"(Contributed by Irit Katriel in :gh:`115775`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:570
msgid ""
"The compiler now creates a :attr:`!__firstlineno__` attribute on classes "
"with the line number of the first line of the class definition. (Contributed "
"by Serhiy Storchaka in :gh:`118465`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:574
msgid ""
"The :func:`exec` and :func:`eval` builtins now accept the *globals* and "
"*locals* arguments as keywords. (Contributed by Raphael Gaschignard "
"in :gh:`105879`)"
msgstr ""
#: ../../whatsnew/3.13.rst:578
msgid ""
"The :func:`compile` builtin now accepts a new flag, "
"``ast.PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST`` except "
"that the returned AST is optimized according to the value of the *optimize* "
"argument. (Contributed by Irit Katriel in :gh:`108113`)."
msgstr ""
#: ../../whatsnew/3.13.rst:584
msgid ""
"Add a :attr:`~property.__name__` attribute on :class:`property` objects. "
"(Contributed by Eugene Toder in :gh:`101860`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:587
msgid ""
"Add :exc:`PythonFinalizationError`, a new exception derived "
"from :exc:`RuntimeError` and used to signal when operations are blocked "
"during :term:`finalization <interpreter shutdown>`. The following callables "
"now raise :exc:`!PythonFinalizationError`, instead of :exc:`RuntimeError`:"
msgstr ""
#: ../../whatsnew/3.13.rst:593
msgid ":func:`_thread.start_new_thread`"
msgstr ":func:`_thread.start_new_thread`"
#: ../../whatsnew/3.13.rst:594
msgid ":func:`os.fork`"
msgstr ":func:`os.fork`"
#: ../../whatsnew/3.13.rst:595
msgid ":func:`os.forkpty`"
msgstr ":func:`os.forkpty`"
#: ../../whatsnew/3.13.rst:596
msgid ":class:`subprocess.Popen`"
msgstr ":class:`subprocess.Popen`"
#: ../../whatsnew/3.13.rst:598
msgid "(Contributed by Victor Stinner in :gh:`114570`.)"
msgstr "(由 Victor Stinner 在 :gh:`114570` 中貢獻。)"
#: ../../whatsnew/3.13.rst:600
msgid ""
"Allow the *count* argument of :meth:`str.replace` to be a keyword. "
"(Contributed by Hugo van Kemenade in :gh:`106487`.)"
msgstr ""
"允許 :meth:`str.replace` 的 *count* 引數為關鍵字。(由 Hugo van Kemenade "
"在 :gh:`106487` 中貢獻。)"
#: ../../whatsnew/3.13.rst:603
msgid ""
"Many functions now emit a warning if a boolean value is passed as a file "
"descriptor argument. This can help catch some errors earlier. (Contributed "
"by Serhiy Storchaka in :gh:`82626`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:608
msgid ""
"Added :attr:`!name` and :attr:`!mode` attributes for compressed and archived "
"file-like objects in the :mod:`bz2`, :mod:`lzma`, :mod:`tarfile`, "
"and :mod:`zipfile` modules. (Contributed by Serhiy Storchaka "
"in :gh:`115961`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:615
msgid "New Modules"
msgstr "新增模組"
#: ../../whatsnew/3.13.rst:617
msgid ""
":mod:`dbm.sqlite3`: An SQLite backend for :mod:`dbm`. (Contributed by "
"Raymond Hettinger and Erlend E. Aasland in :gh:`100414`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:622
msgid "Improved Modules"
msgstr "改進的模組"
#: ../../whatsnew/3.13.rst:626
msgid "argparse"
msgstr "argparse"
#: ../../whatsnew/3.13.rst:628
msgid ""
"Add the *deprecated* parameter to "
"the :meth:`~argparse.ArgumentParser.add_argument` and :meth:`!add_parser` "
"methods, to enable deprecating command-line options, positional arguments, "
"and subcommands. (Contributed by Serhiy Storchaka in :gh:`83648`.)"
msgstr ""
#: ../../whatsnew/3.13.rst:636
msgid "array"
msgstr "array"
#: ../../whatsnew/3.13.rst:638
msgid ""
"Add the ``'w'`` type code (``Py_UCS4``) for Unicode characters. It should be "
"used instead of the deprecated ``'u'`` type code. (Contributed by Inada "
"Naoki in :gh:`80480`.)"