-
-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy path3.3.po
4341 lines (3659 loc) · 144 KB
/
3.3.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.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-03 00:13+0000\n"
"PO-Revision-Date: 2018-05-23 16:20+0000\n"
"Last-Translator: Adrian Liaw <[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"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../whatsnew/3.3.rst:3
msgid "What's New In Python 3.3"
msgstr "Python 3.3 有什麼新功能"
#: ../../whatsnew/3.3.rst:45
msgid ""
"This article explains the new features in Python 3.3, compared to 3.2. "
"Python 3.3 was released on September 29, 2012. For full details, see the "
"`changelog <https://docs.python.org/3.3/whatsnew/changelog.html>`_."
msgstr ""
"本文介紹了 Python 3.3 與 3.2 相比多了哪些新功能。Python 3.1 已於 2012 年 9 "
"月 29 日發布。完整詳情請見 `changelog <https://docs.python.org/3.3/whatsnew/"
"changelog.html>`_。"
#: ../../whatsnew/3.3.rst:51
msgid ":pep:`398` - Python 3.3 Release Schedule"
msgstr ":pep:`398` - Python 3.3 發佈時程"
#: ../../whatsnew/3.3.rst:55
msgid "Summary -- Release highlights"
msgstr "發布重點摘要"
#: ../../whatsnew/3.3.rst:60
msgid "New syntax features:"
msgstr "新增語法特性:"
#: ../../whatsnew/3.3.rst:62
msgid ""
"New ``yield from`` expression for :ref:`generator delegation <pep-380>`."
msgstr ""
#: ../../whatsnew/3.3.rst:63
msgid "The ``u'unicode'`` syntax is accepted again for :class:`str` objects."
msgstr ":class:`str` 物件再次接受 ``u'unicode'`` 語法。"
#: ../../whatsnew/3.3.rst:65
msgid "New library modules:"
msgstr "新的函式庫模組:"
#: ../../whatsnew/3.3.rst:67
msgid ":mod:`faulthandler` (helps debugging low-level crashes)"
msgstr ""
#: ../../whatsnew/3.3.rst:68
msgid ""
":mod:`ipaddress` (high-level objects representing IP addresses and masks)"
msgstr ""
#: ../../whatsnew/3.3.rst:69
msgid ":mod:`lzma` (compress data using the XZ / LZMA algorithm)"
msgstr ""
#: ../../whatsnew/3.3.rst:70
msgid ""
":mod:`unittest.mock` (replace parts of your system under test with mock "
"objects)"
msgstr ""
#: ../../whatsnew/3.3.rst:71
msgid ""
":mod:`venv` (Python :ref:`virtual environments <pep-405>`, as in the popular "
"``virtualenv`` package)"
msgstr ""
#: ../../whatsnew/3.3.rst:74
msgid "New built-in features:"
msgstr "新的內建功能:"
#: ../../whatsnew/3.3.rst:76
msgid "Reworked :ref:`I/O exception hierarchy <pep-3151>`."
msgstr "重新設計 :ref:`I/O 例外層次結構 <pep-3151>`。"
#: ../../whatsnew/3.3.rst:78
msgid "Implementation improvements:"
msgstr "實作改進:"
#: ../../whatsnew/3.3.rst:80
msgid ""
"Rewritten :ref:`import machinery <importlib>` based on :mod:`importlib`."
msgstr ""
#: ../../whatsnew/3.3.rst:81
msgid "More compact :ref:`unicode strings <pep-393>`."
msgstr ""
#: ../../whatsnew/3.3.rst:82
msgid "More compact :ref:`attribute dictionaries <pep-412>`."
msgstr ""
#: ../../whatsnew/3.3.rst:84
msgid "Significantly Improved Library Modules:"
msgstr ""
#: ../../whatsnew/3.3.rst:86
msgid "C Accelerator for the :ref:`decimal <new-decimal>` module."
msgstr ""
#: ../../whatsnew/3.3.rst:87
msgid ""
"Better unicode handling in the :ref:`email <new-email>` module (:term:"
"`provisional <provisional package>`)."
msgstr ""
#: ../../whatsnew/3.3.rst:90
msgid "Security improvements:"
msgstr "安全性改進:"
#: ../../whatsnew/3.3.rst:92
msgid "Hash randomization is switched on by default."
msgstr "預設情況下,雜湊隨機化處於打開狀態。"
#: ../../whatsnew/3.3.rst:94
msgid "Please read on for a comprehensive list of user-facing changes."
msgstr ""
#: ../../whatsnew/3.3.rst:100
msgid "PEP 405: Virtual Environments"
msgstr "PEP 405:虛擬環境"
#: ../../whatsnew/3.3.rst:102
msgid ""
"Virtual environments help create separate Python setups while sharing a "
"system-wide base install, for ease of maintenance. Virtual environments "
"have their own set of private site packages (i.e. locally installed "
"libraries), and are optionally segregated from the system-wide site "
"packages. Their concept and implementation are inspired by the popular "
"``virtualenv`` third-party package, but benefit from tighter integration "
"with the interpreter core."
msgstr ""
#: ../../whatsnew/3.3.rst:110
msgid ""
"This PEP adds the :mod:`venv` module for programmatic access, and the "
"``pyvenv`` script for command-line access and administration. The Python "
"interpreter checks for a ``pyvenv.cfg``, file whose existence signals the "
"base of a virtual environment's directory tree."
msgstr ""
#: ../../whatsnew/3.3.rst:118
msgid ":pep:`405` - Python Virtual Environments"
msgstr ":pep:`405` - Python 虛擬環境"
#: ../../whatsnew/3.3.rst:119
msgid "PEP written by Carl Meyer; implementation by Carl Meyer and Vinay Sajip"
msgstr "由 Carl Meyer 撰寫 PEP;由 Carl Meyer 與 Vinay Sajip 實作"
#: ../../whatsnew/3.3.rst:123
msgid "PEP 420: Implicit Namespace Packages"
msgstr ""
#: ../../whatsnew/3.3.rst:125
msgid ""
"Native support for package directories that don't require ``__init__.py`` "
"marker files and can automatically span multiple path segments (inspired by "
"various third party approaches to namespace packages, as described in :pep:"
"`420`)"
msgstr ""
#: ../../whatsnew/3.3.rst:132
msgid ":pep:`420` - Implicit Namespace Packages"
msgstr ""
#: ../../whatsnew/3.3.rst:133
msgid ""
"PEP written by Eric V. Smith; implementation by Eric V. Smith and Barry "
"Warsaw"
msgstr "由 Eric V. Smith 撰寫 PEP;由 Eric V. Smith 和 Barry Warsaw 實施"
#: ../../whatsnew/3.3.rst:140
msgid ""
"PEP 3118: New memoryview implementation and buffer protocol documentation"
msgstr ""
#: ../../whatsnew/3.3.rst:142
msgid "The implementation of :pep:`3118` has been significantly improved."
msgstr ""
#: ../../whatsnew/3.3.rst:144
msgid ""
"The new memoryview implementation comprehensively fixes all ownership and "
"lifetime issues of dynamically allocated fields in the Py_buffer struct that "
"led to multiple crash reports. Additionally, several functions that crashed "
"or returned incorrect results for non-contiguous or multi-dimensional input "
"have been fixed."
msgstr ""
#: ../../whatsnew/3.3.rst:150
msgid ""
"The memoryview object now has a PEP-3118 compliant getbufferproc() that "
"checks the consumer's request type. Many new features have been added, most "
"of them work in full generality for non-contiguous arrays and arrays with "
"suboffsets."
msgstr ""
#: ../../whatsnew/3.3.rst:155
msgid ""
"The documentation has been updated, clearly spelling out responsibilities "
"for both exporters and consumers. Buffer request flags are grouped into "
"basic and compound flags. The memory layout of non-contiguous and multi-"
"dimensional NumPy-style arrays is explained."
msgstr ""
#: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1125
msgid "Features"
msgstr "功能"
#: ../../whatsnew/3.3.rst:163
msgid ""
"All native single character format specifiers in struct module syntax "
"(optionally prefixed with '@') are now supported."
msgstr ""
#: ../../whatsnew/3.3.rst:166
msgid ""
"With some restrictions, the cast() method allows changing of format and "
"shape of C-contiguous arrays."
msgstr ""
#: ../../whatsnew/3.3.rst:169
msgid ""
"Multi-dimensional list representations are supported for any array type."
msgstr ""
#: ../../whatsnew/3.3.rst:171
msgid "Multi-dimensional comparisons are supported for any array type."
msgstr ""
#: ../../whatsnew/3.3.rst:173
msgid ""
"One-dimensional memoryviews of hashable (read-only) types with formats B, b "
"or c are now hashable. (Contributed by Antoine Pitrou in :issue:`13411`.)"
msgstr ""
#: ../../whatsnew/3.3.rst:176
msgid ""
"Arbitrary slicing of any 1-D arrays type is supported. For example, it is "
"now possible to reverse a memoryview in *O*\\ (1) by using a negative step."
msgstr ""
#: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1135
msgid "API changes"
msgstr "API 變更"
#: ../../whatsnew/3.3.rst:182
msgid "The maximum number of dimensions is officially limited to 64."
msgstr ""
#: ../../whatsnew/3.3.rst:184
msgid ""
"The representation of empty shape, strides and suboffsets is now an empty "
"tuple instead of ``None``."
msgstr ""
#: ../../whatsnew/3.3.rst:187
msgid ""
"Accessing a memoryview element with format 'B' (unsigned bytes) now returns "
"an integer (in accordance with the struct module syntax). For returning a "
"bytes object the view must be cast to 'c' first."
msgstr ""
#: ../../whatsnew/3.3.rst:191
msgid ""
"memoryview comparisons now use the logical structure of the operands and "
"compare all array elements by value. All format strings in struct module "
"syntax are supported. Views with unrecognised format strings are still "
"permitted, but will always compare as unequal, regardless of view contents."
msgstr ""
#: ../../whatsnew/3.3.rst:197
msgid ""
"For further changes see `Build and C API Changes`_ and `Porting C code`_."
msgstr ""
#: ../../whatsnew/3.3.rst:199
msgid "(Contributed by Stefan Krah in :issue:`10181`.)"
msgstr "(由 Stefan Krah 在 :issue:`10181` 中貢獻。)"
#: ../../whatsnew/3.3.rst:203
msgid ":pep:`3118` - Revising the Buffer Protocol"
msgstr ":pep:`3118` - 修訂緩衝協定"
#: ../../whatsnew/3.3.rst:209
msgid "PEP 393: Flexible String Representation"
msgstr ""
#: ../../whatsnew/3.3.rst:211
msgid ""
"The Unicode string type is changed to support multiple internal "
"representations, depending on the character with the largest Unicode ordinal "
"(1, 2, or 4 bytes) in the represented string. This allows a space-efficient "
"representation in common cases, but gives access to full UCS-4 on all "
"systems. For compatibility with existing APIs, several representations may "
"exist in parallel; over time, this compatibility should be phased out."
msgstr ""
#: ../../whatsnew/3.3.rst:218
msgid "On the Python side, there should be no downside to this change."
msgstr ""
#: ../../whatsnew/3.3.rst:220
msgid ""
"On the C API side, :pep:`393` is fully backward compatible. The legacy API "
"should remain available at least five years. Applications using the legacy "
"API will not fully benefit of the memory reduction, or - worse - may use a "
"bit more memory, because Python may have to maintain two versions of each "
"string (in the legacy format and in the new efficient storage)."
msgstr ""
#: ../../whatsnew/3.3.rst:227
msgid "Functionality"
msgstr "功能性"
#: ../../whatsnew/3.3.rst:229
msgid "Changes introduced by :pep:`393` are the following:"
msgstr ":pep:`393` 引入的更改如下:"
#: ../../whatsnew/3.3.rst:231
msgid ""
"Python now always supports the full range of Unicode code points, including "
"non-BMP ones (i.e. from ``U+0000`` to ``U+10FFFF``). The distinction "
"between narrow and wide builds no longer exists and Python now behaves like "
"a wide build, even under Windows."
msgstr ""
#: ../../whatsnew/3.3.rst:236
msgid ""
"With the death of narrow builds, the problems specific to narrow builds have "
"also been fixed, for example:"
msgstr ""
#: ../../whatsnew/3.3.rst:239
msgid ""
":func:`len` now always returns 1 for non-BMP characters, so "
"``len('\\U0010FFFF') == 1``;"
msgstr ""
#: ../../whatsnew/3.3.rst:242
msgid ""
"surrogate pairs are not recombined in string literals, so "
"``'\\uDBFF\\uDFFF' != '\\U0010FFFF'``;"
msgstr ""
#: ../../whatsnew/3.3.rst:245
msgid ""
"indexing or slicing non-BMP characters returns the expected value, so "
"``'\\U0010FFFF'[0]`` now returns ``'\\U0010FFFF'`` and not ``'\\uDBFF'``;"
msgstr ""
#: ../../whatsnew/3.3.rst:248
msgid ""
"all other functions in the standard library now correctly handle non-BMP "
"code points."
msgstr ""
#: ../../whatsnew/3.3.rst:251
msgid ""
"The value of :data:`sys.maxunicode` is now always ``1114111`` (``0x10FFFF`` "
"in hexadecimal). The :c:func:`!PyUnicode_GetMax` function still returns "
"either ``0xFFFF`` or ``0x10FFFF`` for backward compatibility, and it should "
"not be used with the new Unicode API (see :issue:`13054`)."
msgstr ""
#: ../../whatsnew/3.3.rst:256
msgid "The :file:`./configure` flag ``--with-wide-unicode`` has been removed."
msgstr ":file:`./configure` 旗標 ``--with-wide-unicode`` 已被刪除。"
#: ../../whatsnew/3.3.rst:259
msgid "Performance and resource usage"
msgstr "性能和資源使用情況"
#: ../../whatsnew/3.3.rst:261
msgid ""
"The storage of Unicode strings now depends on the highest code point in the "
"string:"
msgstr ""
#: ../../whatsnew/3.3.rst:263
msgid ""
"pure ASCII and Latin1 strings (``U+0000-U+00FF``) use 1 byte per code point;"
msgstr ""
#: ../../whatsnew/3.3.rst:265
msgid "BMP strings (``U+0000-U+FFFF``) use 2 bytes per code point;"
msgstr ""
#: ../../whatsnew/3.3.rst:267
msgid "non-BMP strings (``U+10000-U+10FFFF``) use 4 bytes per code point."
msgstr ""
#: ../../whatsnew/3.3.rst:269
msgid ""
"The net effect is that for most applications, memory usage of string storage "
"should decrease significantly - especially compared to former wide unicode "
"builds - as, in many cases, strings will be pure ASCII even in international "
"contexts (because many strings store non-human language data, such as XML "
"fragments, HTTP headers, JSON-encoded data, etc.). We also hope that it "
"will, for the same reasons, increase CPU cache efficiency on non-trivial "
"applications. The memory usage of Python 3.3 is two to three times smaller "
"than Python 3.2, and a little bit better than Python 2.7, on a Django "
"benchmark (see the PEP for details)."
msgstr ""
#: ../../whatsnew/3.3.rst:282
msgid ":pep:`393` - Flexible String Representation"
msgstr ""
#: ../../whatsnew/3.3.rst:283
msgid ""
"PEP written by Martin von Löwis; implementation by Torsten Becker and Martin "
"von Löwis."
msgstr ""
"PEP 由 Martin von Löwis 撰寫;由 Torsten Becker 和 Martin von Löwis 實作。"
#: ../../whatsnew/3.3.rst:290
msgid "PEP 397: Python Launcher for Windows"
msgstr "PEP 397:適用於 Windows 的 Python 啟動器"
#: ../../whatsnew/3.3.rst:292
msgid ""
"The Python 3.3 Windows installer now includes a ``py`` launcher application "
"that can be used to launch Python applications in a version independent "
"fashion."
msgstr ""
#: ../../whatsnew/3.3.rst:296
msgid ""
"This launcher is invoked implicitly when double-clicking ``*.py`` files. If "
"only a single Python version is installed on the system, that version will "
"be used to run the file. If multiple versions are installed, the most recent "
"version is used by default, but this can be overridden by including a Unix-"
"style \"shebang line\" in the Python script."
msgstr ""
#: ../../whatsnew/3.3.rst:302
msgid ""
"The launcher can also be used explicitly from the command line as the ``py`` "
"application. Running ``py`` follows the same version selection rules as "
"implicitly launching scripts, but a more specific version can be selected by "
"passing appropriate arguments (such as ``-3`` to request Python 3 when "
"Python 2 is also installed, or ``-2.6`` to specifically request an earlier "
"Python version when a more recent version is installed)."
msgstr ""
#: ../../whatsnew/3.3.rst:309
msgid ""
"In addition to the launcher, the Windows installer now includes an option to "
"add the newly installed Python to the system PATH. (Contributed by Brian "
"Curtin in :issue:`3561`.)"
msgstr ""
#: ../../whatsnew/3.3.rst:315
msgid ":pep:`397` - Python Launcher for Windows"
msgstr ":pep:`397` - 適用於 Windows 的 Python 啟動器"
#: ../../whatsnew/3.3.rst:316
msgid ""
"PEP written by Mark Hammond and Martin v. Löwis; implementation by Vinay "
"Sajip."
msgstr "由 Mark Hammond 和 Martin v. Löwis 撰寫 PEP;由 Vinay Sajip 實作。"
#: ../../whatsnew/3.3.rst:319
msgid "Launcher documentation: :ref:`launcher`"
msgstr "啟動器文件::ref:`launcher`"
#: ../../whatsnew/3.3.rst:321
msgid "Installer PATH modification: :ref:`windows-path-mod`"
msgstr ""
#: ../../whatsnew/3.3.rst:327
msgid "PEP 3151: Reworking the OS and IO exception hierarchy"
msgstr ""
#: ../../whatsnew/3.3.rst:329
msgid ""
"The hierarchy of exceptions raised by operating system errors is now both "
"simplified and finer-grained."
msgstr ""
#: ../../whatsnew/3.3.rst:332
msgid ""
"You don't have to worry anymore about choosing the appropriate exception "
"type between :exc:`OSError`, :exc:`IOError`, :exc:`EnvironmentError`, :exc:"
"`WindowsError`, :exc:`mmap.error`, :exc:`socket.error` or :exc:`select."
"error`. All these exception types are now only one: :exc:`OSError`. The "
"other names are kept as aliases for compatibility reasons."
msgstr ""
#: ../../whatsnew/3.3.rst:339
msgid ""
"Also, it is now easier to catch a specific error condition. Instead of "
"inspecting the ``errno`` attribute (or ``args[0]``) for a particular "
"constant from the :mod:`errno` module, you can catch the adequate :exc:"
"`OSError` subclass. The available subclasses are the following:"
msgstr ""
#: ../../whatsnew/3.3.rst:344
msgid ":exc:`BlockingIOError`"
msgstr ":exc:`BlockingIOError`"
#: ../../whatsnew/3.3.rst:345
msgid ":exc:`ChildProcessError`"
msgstr ":exc:`ChildProcessError`"
#: ../../whatsnew/3.3.rst:346
msgid ":exc:`ConnectionError`"
msgstr ":exc:`ConnectionError`"
#: ../../whatsnew/3.3.rst:347
msgid ":exc:`FileExistsError`"
msgstr ":exc:`FileExistsError`"
#: ../../whatsnew/3.3.rst:348
msgid ":exc:`FileNotFoundError`"
msgstr ":exc:`FileNotFoundError`"
#: ../../whatsnew/3.3.rst:349
msgid ":exc:`InterruptedError`"
msgstr ":exc:`InterruptedError`"
#: ../../whatsnew/3.3.rst:350
msgid ":exc:`IsADirectoryError`"
msgstr ":exc:`IsADirectoryError`"
#: ../../whatsnew/3.3.rst:351
msgid ":exc:`NotADirectoryError`"
msgstr ":exc:`NotADirectoryError`"
#: ../../whatsnew/3.3.rst:352
msgid ":exc:`PermissionError`"
msgstr ":exc:`PermissionError`"
#: ../../whatsnew/3.3.rst:353
msgid ":exc:`ProcessLookupError`"
msgstr ":exc:`ProcessLookupError`"
#: ../../whatsnew/3.3.rst:354
msgid ":exc:`TimeoutError`"
msgstr ":exc:`TimeoutError`"
#: ../../whatsnew/3.3.rst:356
msgid "And the :exc:`ConnectionError` itself has finer-grained subclasses:"
msgstr ""
#: ../../whatsnew/3.3.rst:358
msgid ":exc:`BrokenPipeError`"
msgstr ":exc:`BrokenPipeError`"
#: ../../whatsnew/3.3.rst:359
msgid ":exc:`ConnectionAbortedError`"
msgstr ":exc:`ConnectionAbortedError`"
#: ../../whatsnew/3.3.rst:360
msgid ":exc:`ConnectionRefusedError`"
msgstr ":exc:`ConnectionRefusedError`"
#: ../../whatsnew/3.3.rst:361
msgid ":exc:`ConnectionResetError`"
msgstr ":exc:`ConnectionResetError`"
#: ../../whatsnew/3.3.rst:363
msgid ""
"Thanks to the new exceptions, common usages of the :mod:`errno` can now be "
"avoided. For example, the following code written for Python 3.2::"
msgstr ""
#: ../../whatsnew/3.3.rst:366
msgid ""
"from errno import ENOENT, EACCES, EPERM\n"
"\n"
"try:\n"
" with open(\"document.txt\") as f:\n"
" content = f.read()\n"
"except IOError as err:\n"
" if err.errno == ENOENT:\n"
" print(\"document.txt file is missing\")\n"
" elif err.errno in (EACCES, EPERM):\n"
" print(\"You are not allowed to read document.txt\")\n"
" else:\n"
" raise"
msgstr ""
#: ../../whatsnew/3.3.rst:379
msgid ""
"can now be written without the :mod:`errno` import and without manual "
"inspection of exception attributes::"
msgstr ""
#: ../../whatsnew/3.3.rst:382
msgid ""
"try:\n"
" with open(\"document.txt\") as f:\n"
" content = f.read()\n"
"except FileNotFoundError:\n"
" print(\"document.txt file is missing\")\n"
"except PermissionError:\n"
" print(\"You are not allowed to read document.txt\")"
msgstr ""
#: ../../whatsnew/3.3.rst:392
msgid ":pep:`3151` - Reworking the OS and IO Exception Hierarchy"
msgstr ""
#: ../../whatsnew/3.3.rst:393
msgid "PEP written and implemented by Antoine Pitrou"
msgstr "由 Antoine Pitrou 撰寫 PEP 與實作"
#: ../../whatsnew/3.3.rst:402
msgid "PEP 380: Syntax for Delegating to a Subgenerator"
msgstr ""
#: ../../whatsnew/3.3.rst:404
msgid ""
"PEP 380 adds the ``yield from`` expression, allowing a :term:`generator` to "
"delegate part of its operations to another generator. This allows a section "
"of code containing :keyword:`yield` to be factored out and placed in another "
"generator. Additionally, the subgenerator is allowed to return with a value, "
"and the value is made available to the delegating generator."
msgstr ""
#: ../../whatsnew/3.3.rst:411
msgid ""
"While designed primarily for use in delegating to a subgenerator, the "
"``yield from`` expression actually allows delegation to arbitrary "
"subiterators."
msgstr ""
#: ../../whatsnew/3.3.rst:414
msgid ""
"For simple iterators, ``yield from iterable`` is essentially just a "
"shortened form of ``for item in iterable: yield item``::"
msgstr ""
#: ../../whatsnew/3.3.rst:417
msgid ""
">>> def g(x):\n"
"... yield from range(x, 0, -1)\n"
"... yield from range(x)\n"
"...\n"
">>> list(g(5))\n"
"[5, 4, 3, 2, 1, 0, 1, 2, 3, 4]"
msgstr ""
">>> def g(x):\n"
"... yield from range(x, 0, -1)\n"
"... yield from range(x)\n"
"...\n"
">>> list(g(5))\n"
"[5, 4, 3, 2, 1, 0, 1, 2, 3, 4]"
#: ../../whatsnew/3.3.rst:424
msgid ""
"However, unlike an ordinary loop, ``yield from`` allows subgenerators to "
"receive sent and thrown values directly from the calling scope, and return a "
"final value to the outer generator::"
msgstr ""
#: ../../whatsnew/3.3.rst:428
msgid ""
">>> def accumulate():\n"
"... tally = 0\n"
"... while 1:\n"
"... next = yield\n"
"... if next is None:\n"
"... return tally\n"
"... tally += next\n"
"...\n"
">>> def gather_tallies(tallies):\n"
"... while 1:\n"
"... tally = yield from accumulate()\n"
"... tallies.append(tally)\n"
"...\n"
">>> tallies = []\n"
">>> acc = gather_tallies(tallies)\n"
">>> next(acc) # Ensure the accumulator is ready to accept values\n"
">>> for i in range(4):\n"
"... acc.send(i)\n"
"...\n"
">>> acc.send(None) # Finish the first tally\n"
">>> for i in range(5):\n"
"... acc.send(i)\n"
"...\n"
">>> acc.send(None) # Finish the second tally\n"
">>> tallies\n"
"[6, 10]"
msgstr ""
#: ../../whatsnew/3.3.rst:455
msgid ""
"The main principle driving this change is to allow even generators that are "
"designed to be used with the ``send`` and ``throw`` methods to be split into "
"multiple subgenerators as easily as a single large function can be split "
"into multiple subfunctions."
msgstr ""
#: ../../whatsnew/3.3.rst:462
msgid ":pep:`380` - Syntax for Delegating to a Subgenerator"
msgstr ""
#: ../../whatsnew/3.3.rst:463
msgid ""
"PEP written by Greg Ewing; implementation by Greg Ewing, integrated into 3.3 "
"by Renaud Blanch, Ryan Kelly and Nick Coghlan; documentation by Zbigniew "
"Jędrzejewski-Szmek and Nick Coghlan"
msgstr ""
#: ../../whatsnew/3.3.rst:469
msgid "PEP 409: Suppressing exception context"
msgstr ""
#: ../../whatsnew/3.3.rst:471
msgid ""
"PEP 409 introduces new syntax that allows the display of the chained "
"exception context to be disabled. This allows cleaner error messages in "
"applications that convert between exception types::"
msgstr ""
#: ../../whatsnew/3.3.rst:475
msgid ""
">>> class D:\n"
"... def __init__(self, extra):\n"
"... self._extra_attributes = extra\n"
"... def __getattr__(self, attr):\n"
"... try:\n"
"... return self._extra_attributes[attr]\n"
"... except KeyError:\n"
"... raise AttributeError(attr) from None\n"
"...\n"
">>> D({}).x\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
" File \"<stdin>\", line 8, in __getattr__\n"
"AttributeError: x"
msgstr ""
">>> class D:\n"
"... def __init__(self, extra):\n"
"... self._extra_attributes = extra\n"
"... def __getattr__(self, attr):\n"
"... try:\n"
"... return self._extra_attributes[attr]\n"
"... except KeyError:\n"
"... raise AttributeError(attr) from None\n"
"...\n"
">>> D({}).x\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
" File \"<stdin>\", line 8, in __getattr__\n"
"AttributeError: x"
#: ../../whatsnew/3.3.rst:490
msgid ""
"Without the ``from None`` suffix to suppress the cause, the original "
"exception would be displayed by default::"
msgstr ""
#: ../../whatsnew/3.3.rst:493
msgid ""
">>> class C:\n"
"... def __init__(self, extra):\n"
"... self._extra_attributes = extra\n"
"... def __getattr__(self, attr):\n"
"... try:\n"
"... return self._extra_attributes[attr]\n"
"... except KeyError:\n"
"... raise AttributeError(attr)\n"
"...\n"
">>> C({}).x\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 6, in __getattr__\n"
"KeyError: 'x'\n"
"\n"
"During handling of the above exception, another exception occurred:\n"
"\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
" File \"<stdin>\", line 8, in __getattr__\n"
"AttributeError: x"
msgstr ""
">>> class C:\n"
"... def __init__(self, extra):\n"
"... self._extra_attributes = extra\n"
"... def __getattr__(self, attr):\n"
"... try:\n"
"... return self._extra_attributes[attr]\n"
"... except KeyError:\n"
"... raise AttributeError(attr)\n"
"...\n"
">>> C({}).x\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 6, in __getattr__\n"
"KeyError: 'x'\n"
"\n"
"During handling of the above exception, another exception occurred:\n"
"\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
" File \"<stdin>\", line 8, in __getattr__\n"
"AttributeError: x"
#: ../../whatsnew/3.3.rst:514
msgid ""
"No debugging capability is lost, as the original exception context remains "
"available if needed (for example, if an intervening library has incorrectly "
"suppressed valuable underlying details)::"
msgstr ""
#: ../../whatsnew/3.3.rst:518
msgid ""
">>> try:\n"
"... D({}).x\n"
"... except AttributeError as exc:\n"
"... print(repr(exc.__context__))\n"
"...\n"
"KeyError('x',)"
msgstr ""
">>> try:\n"
"... D({}).x\n"
"... except AttributeError as exc:\n"
"... print(repr(exc.__context__))\n"
"...\n"
"KeyError('x',)"
#: ../../whatsnew/3.3.rst:527
msgid ":pep:`409` - Suppressing exception context"
msgstr ""
#: ../../whatsnew/3.3.rst:528
msgid ""
"PEP written by Ethan Furman; implemented by Ethan Furman and Nick Coghlan."
msgstr ""
#: ../../whatsnew/3.3.rst:533
msgid "PEP 414: Explicit Unicode literals"
msgstr ""
#: ../../whatsnew/3.3.rst:535
msgid ""
"To ease the transition from Python 2 for Unicode aware Python applications "
"that make heavy use of Unicode literals, Python 3.3 once again supports the "
"\"``u``\" prefix for string literals. This prefix has no semantic "
"significance in Python 3, it is provided solely to reduce the number of "
"purely mechanical changes in migrating to Python 3, making it easier for "
"developers to focus on the more significant semantic changes (such as the "
"stricter default separation of binary and text data)."
msgstr ""
#: ../../whatsnew/3.3.rst:545
msgid ":pep:`414` - Explicit Unicode literals"
msgstr ""
#: ../../whatsnew/3.3.rst:546
msgid "PEP written by Armin Ronacher."
msgstr "由 Armin Ronacher 撰寫 PEP。"
#: ../../whatsnew/3.3.rst:550
msgid "PEP 3155: Qualified name for classes and functions"
msgstr ""
#: ../../whatsnew/3.3.rst:552
msgid ""
"Functions and class objects have a new :attr:`~definition.__qualname__` "
"attribute representing the \"path\" from the module top-level to their "
"definition. For global functions and classes, this is the same as :attr:"
"`~definition.__name__`. For other functions and classes, it provides better "
"information about where they were actually defined, and how they might be "
"accessible from the global scope."
msgstr ""
#: ../../whatsnew/3.3.rst:560
msgid "Example with (non-bound) methods::"
msgstr ""
#: ../../whatsnew/3.3.rst:562
msgid ""
">>> class C:\n"
"... def meth(self):\n"
"... pass\n"
"...\n"
">>> C.meth.__name__\n"
"'meth'\n"
">>> C.meth.__qualname__\n"
"'C.meth'"
msgstr ""
">>> class C:\n"
"... def meth(self):\n"
"... pass\n"
"...\n"
">>> C.meth.__name__\n"
"'meth'\n"
">>> C.meth.__qualname__\n"
"'C.meth'"
#: ../../whatsnew/3.3.rst:571
msgid "Example with nested classes::"
msgstr "巢狀類別範例: ::"
#: ../../whatsnew/3.3.rst:573
msgid ""
">>> class C:\n"
"... class D:\n"
"... def meth(self):\n"
"... pass\n"
"...\n"
">>> C.D.__name__\n"
"'D'\n"
">>> C.D.__qualname__\n"
"'C.D'\n"
">>> C.D.meth.__name__\n"
"'meth'\n"
">>> C.D.meth.__qualname__\n"
"'C.D.meth'"
msgstr ""
">>> class C:\n"
"... class D:\n"
"... def meth(self):\n"
"... pass\n"
"...\n"
">>> C.D.__name__\n"
"'D'\n"
">>> C.D.__qualname__\n"
"'C.D'\n"
">>> C.D.meth.__name__\n"
"'meth'\n"
">>> C.D.meth.__qualname__\n"
"'C.D.meth'"
#: ../../whatsnew/3.3.rst:587
msgid "Example with nested functions::"
msgstr "巢狀函式範例: ::"
#: ../../whatsnew/3.3.rst:589
msgid ""
">>> def outer():\n"
"... def inner():\n"
"... pass\n"
"... return inner\n"
"...\n"
">>> outer().__name__\n"
"'inner'\n"
">>> outer().__qualname__\n"
"'outer.<locals>.inner'"
msgstr ""
">>> def outer():\n"
"... def inner():\n"
"... pass\n"
"... return inner\n"
"...\n"
">>> outer().__name__\n"
"'inner'\n"
">>> outer().__qualname__\n"
"'outer.<locals>.inner'"
#: ../../whatsnew/3.3.rst:599
msgid ""
"The string representation of those objects is also changed to include the "
"new, more precise information::"
msgstr ""
#: ../../whatsnew/3.3.rst:602
msgid ""
">>> str(C.D)\n"
"\"<class '__main__.C.D'>\"\n"
">>> str(C.D.meth)\n"
"'<function C.D.meth at 0x7f46b9fe31e0>'"
msgstr ""
">>> str(C.D)\n"
"\"<class '__main__.C.D'>\"\n"
">>> str(C.D.meth)\n"
"'<function C.D.meth at 0x7f46b9fe31e0>'"
#: ../../whatsnew/3.3.rst:609
msgid ":pep:`3155` - Qualified name for classes and functions"
msgstr ""
#: ../../whatsnew/3.3.rst:610
msgid "PEP written and implemented by Antoine Pitrou."
msgstr "由 Antoine Pitrou 撰寫 PEP 與實作。"
#: ../../whatsnew/3.3.rst:616
msgid "PEP 412: Key-Sharing Dictionary"
msgstr ""
#: ../../whatsnew/3.3.rst:618