-
-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathfunctions.po
More file actions
3968 lines (3450 loc) · 158 KB
/
functions.po
File metadata and controls
3968 lines (3450 loc) · 158 KB
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 Python Software Foundation
# This file is distributed under the same license as the Python package.
# Translators:
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
# nienzu <ibqqz0602@gmail.com>, 2018
# Matt Wang <mattwang44@gmail.com>, 2021
# Phil Lin <linooohon@gmail.com>, 2022
# Steven Hsu <hsuhaochun@gmail.com>, 2023
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-15 00:16+0000\n"
"PO-Revision-Date: 2024-05-06 17:06+0800\n"
"Last-Translator: KNChiu <y9760210@gmail.com>\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"
"X-Generator: Poedit 3.4.2\n"
#: ../../library/functions.rst:5 ../../library/functions.rst:11
msgid "Built-in Functions"
msgstr "內建函式"
#: ../../library/functions.rst:7
msgid ""
"The Python interpreter has a number of functions and types built into it "
"that are always available. They are listed here in alphabetical order."
msgstr ""
"Python 直譯器有內建多個可隨時使用的函式和型別。以下按照英文字母排序列出。"
#: ../../library/functions.rst:13
msgid "**A**"
msgstr "**A**"
#: ../../library/functions.rst:14
msgid ":func:`abs`"
msgstr ":func:`abs`"
#: ../../library/functions.rst:15
msgid ":func:`aiter`"
msgstr ":func:`aiter`"
#: ../../library/functions.rst:16
msgid ":func:`all`"
msgstr ":func:`all`"
#: ../../library/functions.rst:17
msgid ":func:`anext`"
msgstr ":func:`anext`"
#: ../../library/functions.rst:18
msgid ":func:`any`"
msgstr ":func:`any`"
#: ../../library/functions.rst:19
msgid ":func:`ascii`"
msgstr ":func:`ascii`"
#: ../../library/functions.rst:21
msgid "**B**"
msgstr "**B**"
#: ../../library/functions.rst:22
msgid ":func:`bin`"
msgstr ":func:`bin`"
#: ../../library/functions.rst:23
msgid ":func:`bool`"
msgstr ":func:`bool`"
#: ../../library/functions.rst:24
msgid ":func:`breakpoint`"
msgstr ":func:`breakpoint`"
#: ../../library/functions.rst:25
msgid "|func-bytearray|_"
msgstr "|func-bytearray|_"
#: ../../library/functions.rst:26
msgid "|func-bytes|_"
msgstr "|func-bytes|_"
#: ../../library/functions.rst:28
msgid "**C**"
msgstr "**C**"
#: ../../library/functions.rst:29
msgid ":func:`callable`"
msgstr ":func:`callable`"
#: ../../library/functions.rst:30
msgid ":func:`chr`"
msgstr ":func:`chr`"
#: ../../library/functions.rst:31
msgid ":func:`classmethod`"
msgstr ":func:`classmethod`"
#: ../../library/functions.rst:32
msgid ":func:`compile`"
msgstr ":func:`compile`"
#: ../../library/functions.rst:33
msgid ":func:`complex`"
msgstr ":func:`complex`"
#: ../../library/functions.rst:35
msgid "**D**"
msgstr "**D**"
#: ../../library/functions.rst:36
msgid ":func:`delattr`"
msgstr ":func:`delattr`"
#: ../../library/functions.rst:37
msgid "|func-dict|_"
msgstr "|func-dict|_"
#: ../../library/functions.rst:38
msgid ":func:`dir`"
msgstr ":func:`dir`"
#: ../../library/functions.rst:39
msgid ":func:`divmod`"
msgstr ":func:`divmod`"
#: ../../library/functions.rst:13
msgid "**E**"
msgstr "**E**"
#: ../../library/functions.rst:14
msgid ":func:`enumerate`"
msgstr ":func:`enumerate`"
#: ../../library/functions.rst:15
msgid ":func:`eval`"
msgstr ":func:`eval`"
#: ../../library/functions.rst:16
msgid ":func:`exec`"
msgstr ":func:`exec`"
#: ../../library/functions.rst:18
msgid "**F**"
msgstr "**F**"
#: ../../library/functions.rst:19
msgid ":func:`filter`"
msgstr ":func:`filter`"
#: ../../library/functions.rst:20
msgid ":func:`float`"
msgstr ":func:`float`"
#: ../../library/functions.rst:21
msgid ":func:`format`"
msgstr ":func:`format`"
#: ../../library/functions.rst:22
msgid "|func-frozenset|_"
msgstr "|func-frozenset|_"
#: ../../library/functions.rst:24
msgid "**G**"
msgstr "**G**"
#: ../../library/functions.rst:25
msgid ":func:`getattr`"
msgstr ":func:`getattr`"
#: ../../library/functions.rst:26
msgid ":func:`globals`"
msgstr ":func:`globals`"
#: ../../library/functions.rst:28
msgid "**H**"
msgstr "**H**"
#: ../../library/functions.rst:29
msgid ":func:`hasattr`"
msgstr ":func:`hasattr`"
#: ../../library/functions.rst:30
msgid ":func:`hash`"
msgstr ":func:`hash`"
#: ../../library/functions.rst:31
msgid ":func:`help`"
msgstr ":func:`help`"
#: ../../library/functions.rst:32
msgid ":func:`hex`"
msgstr ":func:`hex`"
#: ../../library/functions.rst:34
msgid "**I**"
msgstr "**I**"
#: ../../library/functions.rst:35
msgid ":func:`id`"
msgstr ":func:`id`"
#: ../../library/functions.rst:36
msgid ":func:`input`"
msgstr ":func:`input`"
#: ../../library/functions.rst:37
msgid ":func:`int`"
msgstr ":func:`int`"
#: ../../library/functions.rst:38
msgid ":func:`isinstance`"
msgstr ":func:`isinstance`"
#: ../../library/functions.rst:39
msgid ":func:`issubclass`"
msgstr ":func:`issubclass`"
#: ../../library/functions.rst:40
msgid ":func:`iter`"
msgstr ":func:`iter`"
#: ../../library/functions.rst:13
msgid "**L**"
msgstr "**L**"
#: ../../library/functions.rst:14
msgid ":func:`len`"
msgstr ":func:`len`"
#: ../../library/functions.rst:15
msgid "|func-list|_"
msgstr "|func-list|_"
#: ../../library/functions.rst:16
msgid ":func:`locals`"
msgstr ":func:`locals`"
#: ../../library/functions.rst:18
msgid "**M**"
msgstr "**M**"
#: ../../library/functions.rst:19
msgid ":func:`map`"
msgstr ":func:`map`"
#: ../../library/functions.rst:20
msgid ":func:`max`"
msgstr ":func:`max`"
#: ../../library/functions.rst:21
msgid "|func-memoryview|_"
msgstr "|func-memoryview|_"
#: ../../library/functions.rst:22
msgid ":func:`min`"
msgstr ":func:`min`"
#: ../../library/functions.rst:24
msgid "**N**"
msgstr "**N**"
#: ../../library/functions.rst:25
msgid ":func:`next`"
msgstr ":func:`next`"
#: ../../library/functions.rst:27
msgid "**O**"
msgstr "**O**"
#: ../../library/functions.rst:28
msgid ":func:`object`"
msgstr ":func:`object`"
#: ../../library/functions.rst:29
msgid ":func:`oct`"
msgstr ":func:`oct`"
#: ../../library/functions.rst:30
msgid ":func:`open`"
msgstr ":func:`open`"
#: ../../library/functions.rst:31
msgid ":func:`ord`"
msgstr ":func:`ord`"
#: ../../library/functions.rst:33
msgid "**P**"
msgstr "**P**"
#: ../../library/functions.rst:34
msgid ":func:`pow`"
msgstr ":func:`pow`"
#: ../../library/functions.rst:35
msgid ":func:`print`"
msgstr ":func:`print`"
#: ../../library/functions.rst:36
msgid ":func:`property`"
msgstr ":func:`property`"
#: ../../library/functions.rst:13
msgid "**R**"
msgstr "**R**"
#: ../../library/functions.rst:14
msgid "|func-range|_"
msgstr "|func-range|_"
#: ../../library/functions.rst:15
msgid ":func:`repr`"
msgstr ":func:`repr`"
#: ../../library/functions.rst:16
msgid ":func:`reversed`"
msgstr ":func:`reversed`"
#: ../../library/functions.rst:17
msgid ":func:`round`"
msgstr ":func:`round`"
#: ../../library/functions.rst:19
msgid "**S**"
msgstr "**S**"
#: ../../library/functions.rst:20
msgid "|func-set|_"
msgstr "|func-set|_"
#: ../../library/functions.rst:21
msgid ":func:`setattr`"
msgstr ":func:`setattr`"
#: ../../library/functions.rst:22
msgid ":func:`slice`"
msgstr ":func:`slice`"
#: ../../library/functions.rst:23
msgid ":func:`sorted`"
msgstr ":func:`sorted`"
#: ../../library/functions.rst:24
msgid ":func:`staticmethod`"
msgstr ":func:`staticmethod`"
#: ../../library/functions.rst:25
msgid "|func-str|_"
msgstr "|func-str|_"
#: ../../library/functions.rst:26
msgid ":func:`sum`"
msgstr ":func:`sum`"
#: ../../library/functions.rst:27
msgid ":func:`super`"
msgstr ":func:`super`"
#: ../../library/functions.rst:29
msgid "**T**"
msgstr "**T**"
#: ../../library/functions.rst:30
msgid "|func-tuple|_"
msgstr "|func-tuple|_"
#: ../../library/functions.rst:31
msgid ":func:`type`"
msgstr ":func:`type`"
#: ../../library/functions.rst:33
msgid "**V**"
msgstr "**V**"
#: ../../library/functions.rst:34
msgid ":func:`vars`"
msgstr ":func:`vars`"
#: ../../library/functions.rst:36
msgid "**Z**"
msgstr "**Z**"
#: ../../library/functions.rst:37
msgid ":func:`zip`"
msgstr ":func:`zip`"
#: ../../library/functions.rst:39
msgid "**_**"
msgstr "**_**"
#: ../../library/functions.rst:40
msgid ":func:`__import__`"
msgstr ":func:`__import__`"
#: ../../library/functions.rst:59
msgid ""
"Return the absolute value of a number. The argument may be an integer, a "
"floating-point number, or an object implementing :meth:`~object.__abs__`. If "
"the argument is a complex number, its magnitude is returned."
msgstr ""
"回傳一個數的絕對值,引數可以是整數、浮點數或有實現 :meth:`~object.__abs__` 的"
"物件。如果引數是一個複數,回傳它的純量(大小)。"
#: ../../library/functions.rst:67
msgid ""
"Return an :term:`asynchronous iterator` for an :term:`asynchronous "
"iterable`. Equivalent to calling ``x.__aiter__()``."
msgstr ""
"回傳 :term:`非同步疊代器 <asynchronous iterator>` 做為 :term:`非同步可疊代物"
"件 <asynchronous iterable>`。相當於呼叫 x.__aiter__()。"
#: ../../library/functions.rst:70
msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant."
msgstr "注意:與 :func:`iter` 不同,:func:`aiter` 沒有兩個引數的變體。"
#: ../../library/functions.rst:76
msgid ""
"Return ``True`` if all elements of the *iterable* are true (or if the "
"iterable is empty). Equivalent to::"
msgstr ""
"如果 *iterable* 的所有元素皆為真(或 iterable 為空)則回傳 ``True``。等價"
"於: ::"
#: ../../library/functions.rst:79
msgid ""
"def all(iterable):\n"
" for element in iterable:\n"
" if not element:\n"
" return False\n"
" return True"
msgstr ""
"def all(iterable):\n"
" for element in iterable:\n"
" if not element:\n"
" return False\n"
" return True"
#: ../../library/functions.rst:89
msgid ""
"When awaited, return the next item from the given :term:`asynchronous "
"iterator`, or *default* if given and the iterator is exhausted."
msgstr ""
"當進入 await 時,從給定的 :term:`asynchronous iterator` 中回傳下一個項目"
"(item),疊代完畢則回傳 *default* 。"
#: ../../library/functions.rst:92
msgid ""
"This is the async variant of the :func:`next` builtin, and behaves similarly."
msgstr "這是內建函式 :func:`next` 的非同步版本,其行為類似於:"
#: ../../library/functions.rst:95
msgid ""
"This calls the :meth:`~object.__anext__` method of *async_iterator*, "
"returning an :term:`awaitable`. Awaiting this returns the next value of the "
"iterator. If *default* is given, it is returned if the iterator is "
"exhausted, otherwise :exc:`StopAsyncIteration` is raised."
msgstr ""
"呼叫 *async_iterator* 的 :meth:`~object.__anext__` 方法,回傳 :term:"
"`awaitable`。等待返回疊代器的下一個值。如果指定 *default*,當疊代器結束時會返"
"回該值,否則會引發 :exc:`StopAsyncIteration` 。"
#: ../../library/functions.rst:104
msgid ""
"Return ``True`` if any element of the *iterable* is true. If the iterable "
"is empty, return ``False``. Equivalent to::"
msgstr ""
"如果 *iterable* 的任一元素為真,回傳 ``True``。如果 iterable 是空的,則回傳 "
"``False``。等價於: ::"
#: ../../library/functions.rst:107
msgid ""
"def any(iterable):\n"
" for element in iterable:\n"
" if element:\n"
" return True\n"
" return False"
msgstr ""
"def any(iterable):\n"
" for element in iterable:\n"
" if element:\n"
" return True\n"
" return False"
#: ../../library/functions.rst:116
msgid ""
"As :func:`repr`, return a string containing a printable representation of an "
"object, but escape the non-ASCII characters in the string returned by :func:"
"`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string "
"similar to that returned by :func:`repr` in Python 2."
msgstr ""
"就像函式 :func:`repr`,回傳一個表示物件的字串,但是 :func:`repr` 回傳的字串中"
"非 ASCII 編碼的字元會被跳脫 (escape),像是 ``\\x``、``\\u`` 和 ``\\U``。這個"
"函式生成的字串和 Python 2 的 :func:`repr` 回傳的結果相似。"
#: ../../library/functions.rst:124
msgid ""
"Convert an integer number to a binary string prefixed with \"0b\". The "
"result is a valid Python expression. If *integer* is not a Python :class:"
"`int` object, it has to define an :meth:`~object.__index__` method that "
"returns an integer. Some examples:"
msgstr ""
"將一個整數轉變為一個前綴為 \"0b\" 的二進位制字串。結果是一個有效的 Python 運"
"算式。如果 *integer* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:"
"`~object.__index__` method 回傳一個整數。舉例來說:"
#: ../../library/functions.rst:134
msgid ""
"If the prefix \"0b\" is desired or not, you can use either of the following "
"ways."
msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。"
#: ../../library/functions.rst:141 ../../library/functions.rst:948
#: ../../library/functions.rst:1332
msgid "See also :func:`format` for more information."
msgstr "可參考 :func:`format` 取得更多資訊。"
#: ../../library/functions.rst:146
msgid ""
"Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is "
"converted using the standard :ref:`truth testing procedure <truth>`. If the "
"argument is false or omitted, this returns ``False``; otherwise, it returns "
"``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:"
"`typesnumeric`). It cannot be subclassed further. Its only instances are "
"``False`` and ``True`` (see :ref:`typebool`)."
msgstr ""
"回傳一個布林值,即 ``True`` 或者 ``False``。引數會使用標準的\\ :ref:`真值測試"
"程序 <truth>`\\ 來轉換。如果引數為假或者被省略,則回傳 ``False``;其他情況回"
"傳 ``True``。:class:`bool` class(類別)是 :class:`int` 的 subclass(子類別)"
"(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 "
"``True`` 兩個實例(參見 :ref:`typebool`)。"
#: ../../library/functions.rst:156 ../../library/functions.rst:813
msgid "The parameter is now positional-only."
msgstr "現在為僅限位置參數。"
#: ../../library/functions.rst:161
msgid ""
"This function drops you into the debugger at the call site. Specifically, "
"it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight "
"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` "
"expecting no arguments. In this case, it is purely a convenience function "
"so you don't have to explicitly import :mod:`pdb` or type as much code to "
"enter the debugger. However, :func:`sys.breakpointhook` can be set to some "
"other function and :func:`breakpoint` will automatically call that, allowing "
"you to drop into the debugger of choice. If :func:`sys.breakpointhook` is "
"not accessible, this function will raise :exc:`RuntimeError`."
msgstr ""
"這個函式將呼叫 :func:`sys.breakpointhook` 函式,並將 ``args`` 和 ``kws`` 傳遞"
"給它。這將有效地讓你在特定的呼叫點進入除錯器。預設情況下,``sys."
"breakpointhook()`` 呼叫 :func:`pdb.set_trace` 不須帶任何引數。這樣的設計是為"
"了方便使用者,讓他們不需要額外地導入 :mod:`pdb` 模組或輸入太多程式就可以進入"
"除錯器。然而,可以將 :func:`sys.breakpointhook` 設置為其他函式,並且 :func:"
"`breakpoint` 將自動呼叫該函式,讓你進入所選擇的除錯器。如果無法存取 :func:"
"`sys.breakpointhook` 這個函式,則此函式將引發 :exc:`RuntimeError`。"
#: ../../library/functions.rst:173
msgid ""
"By default, the behavior of :func:`breakpoint` can be changed with the :"
"envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys."
"breakpointhook` for usage details."
msgstr ""
"預設情況下,:func:`breakpoint` 的行為可以透過 :envvar:`PYTHONBREAKPOINT` 環境"
"變數來更改。有關使用詳情,請參考 :func:`sys.breakpointhook`。"
#: ../../library/functions.rst:177
msgid ""
"Note that this is not guaranteed if :func:`sys.breakpointhook` has been "
"replaced."
msgstr "請注意,如果 :func:`sys.breakpointhook` 被替換了,則無法保證此功能。"
#: ../../library/functions.rst:180
msgid ""
"Raises an :ref:`auditing event <auditing>` ``builtins.breakpoint`` with "
"argument ``breakpointhook``."
msgstr ""
"引發一個附帶引數 ``breakpointhook`` 的\\ :ref:`稽核事件 <auditing>` "
"``builtins.breakpoint``。"
#: ../../library/functions.rst:189
msgid ""
"Return a new array of bytes. The :class:`bytearray` class is a mutable "
"sequence of integers in the range 0 <= x < 256. It has most of the usual "
"methods of mutable sequences, described in :ref:`typesseq-mutable`, as well "
"as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`."
msgstr ""
"回傳一個新的 bytes 陣列。:class:`bytearray` class 是一個可變的整數序列,包含"
"範圍為 0 <= x < 256 的整數。它有可變序列大部分常見的 method(如在 :ref:"
"`typesseq-mutable` 中所述),同時也有 :class:`bytes` 型別大部分的 method,參"
"見 :ref:`bytes-methods`。"
#: ../../library/functions.rst:194
msgid ""
"The optional *source* parameter can be used to initialize the array in a few "
"different ways:"
msgstr "選擇性參數 *source* 可以被用來以不同的方式初始化陣列:"
#: ../../library/functions.rst:197
msgid ""
"If it is a *string*, you must also give the *encoding* (and optionally, "
"*errors*) parameters; :func:`bytearray` then converts the string to bytes "
"using :meth:`str.encode`."
msgstr ""
"如果是一個 *string*,你必須提供 *encoding* 參數(以及選擇性地提供 "
"*errors* );:func:`bytearray` 會使用 :meth:`str.encode` method 來將 string "
"轉變成 bytes。"
#: ../../library/functions.rst:201
msgid ""
"If it is an *integer*, the array will have that size and will be initialized "
"with null bytes."
msgstr ""
"如果是一個 *integer*,陣列則會有該數值的長度,並以 null bytes 來當作初始值。"
#: ../../library/functions.rst:204
msgid ""
"If it is an object conforming to the :ref:`buffer interface "
"<bufferobjects>`, a read-only buffer of the object will be used to "
"initialize the bytes array."
msgstr ""
"如果是一個符合 :ref:`buffer 介面 <bufferobjects>`\\ 的物件,該物件的唯讀 "
"buffer 會被用來初始化 bytes 陣列。"
#: ../../library/functions.rst:207
msgid ""
"If it is an *iterable*, it must be an iterable of integers in the range ``0 "
"<= x < 256``, which are used as the initial contents of the array."
msgstr ""
"如果是一個 *iterable*,它的元素必須是範圍為 ``0 <= x < 256`` 的整數,並且會被"
"用作陣列的初始值。"
#: ../../library/functions.rst:210
msgid "Without an argument, an array of size 0 is created."
msgstr "如果沒有引數,則建立長度為 0 的陣列。"
#: ../../library/functions.rst:212
msgid "See also :ref:`binaryseq` and :ref:`typebytearray`."
msgstr "可參考 :ref:`binaryseq` 和 :ref:`typebytearray`。"
#: ../../library/functions.rst:220
msgid ""
"Return a new \"bytes\" object which is an immutable sequence of integers in "
"the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :"
"class:`bytearray` -- it has the same non-mutating methods and the same "
"indexing and slicing behavior."
msgstr ""
"回傳一個新的 \"bytes\" 物件,會是一個元素是範圍為 ``0 <= x < 256`` 整數的不可"
"變序列。:class:`bytes` 是 :class:`bytearray` 的不可變版本 — 它的同樣具備不改"
"變物件的 method,也有相同的索引和切片操作。"
#: ../../library/functions.rst:225
msgid ""
"Accordingly, constructor arguments are interpreted as for :func:`bytearray`."
msgstr "因此,建構函式的引數和 :func:`bytearray` 相同。"
#: ../../library/functions.rst:227
msgid "Bytes objects can also be created with literals, see :ref:`strings`."
msgstr "Bytes 物件還可以用文字建立,參見 :ref:`strings`。"
#: ../../library/functions.rst:229
msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`."
msgstr "可參考 :ref:`binaryseq`、:ref:`typebytes` 和 :ref:`bytes-methods`。"
#: ../../library/functions.rst:234
msgid ""
"Return :const:`True` if the *object* argument appears callable, :const:"
"`False` if not. If this returns ``True``, it is still possible that a call "
"fails, but if it is ``False``, calling *object* will never succeed. Note "
"that classes are callable (calling a class returns a new instance); "
"instances are callable if their class has a :meth:`~object.__call__` method."
msgstr ""
"如果引數 *object* 是可呼叫的,回傳 :const:`True`,否則回傳 :const:`False`。如"
"果回傳 ``True``,呼叫仍可能會失敗;但如果回傳 ``False``,則呼叫 *object* 肯定"
"會失敗。注意 class 是可呼叫的(呼叫 class 會回傳一個新的實例);如果實例的 "
"class 有定義 :meth:`~object.__call__` method,則它是可呼叫的。"
#: ../../library/functions.rst:240
msgid ""
"This function was first removed in Python 3.0 and then brought back in "
"Python 3.2."
msgstr "這個函式一開始在 Python 3.0 被移除,但在 Python 3.2 又被重新加入。"
#: ../../library/functions.rst:247
msgid ""
"Return the string representing a character with the specified Unicode code "
"point. For example, ``chr(97)`` returns the string ``'a'``, while "
"``chr(8364)`` returns the string ``'€'``. This is the inverse of :func:`ord`."
msgstr ""
"回傳代表有特定 Unicode 編碼位置字元的字串。例如,``chr(97)`` 回傳字串 "
"``'a'``,而 ``chr(8364)`` 回傳字串 ``'€'``。這是 :func:`ord` 的逆函式。"
#: ../../library/functions.rst:251
msgid ""
"The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in "
"base 16). :exc:`ValueError` will be raised if it is outside that range."
msgstr ""
"引數的有效範圍是 0 到 1,114,111(16 進制表示為 0x10FFFF)。如果它超過這個範"
"圍,會引發 :exc:`ValueError`。"
#: ../../library/functions.rst:257
msgid "Transform a method into a class method."
msgstr "把一個 method 封裝成 class method(類別方法)。"
#: ../../library/functions.rst:259
msgid ""
"A class method receives the class as an implicit first argument, just like "
"an instance method receives the instance. To declare a class method, use "
"this idiom::"
msgstr ""
"一個 class method 把自己的 class 作為第一個引數,就像一個實例 method 把實例自"
"己作為第一個引數。請用以下慣例來宣告 class method: ::"
#: ../../library/functions.rst:263
msgid ""
"class C:\n"
" @classmethod\n"
" def f(cls, arg1, arg2): ..."
msgstr ""
"class C:\n"
" @classmethod\n"
" def f(cls, arg1, arg2): ..."
#: ../../library/functions.rst:267
msgid ""
"The ``@classmethod`` form is a function :term:`decorator` -- see :ref:"
"`function` for details."
msgstr ""
"``@classmethod`` 語法是一個函式 :term:`decorator` — 參見 :ref:`function` 中關"
"於函式定義的詳細介紹。"
#: ../../library/functions.rst:270
msgid ""
"A class method can be called either on the class (such as ``C.f()``) or on "
"an instance (such as ``C().f()``). The instance is ignored except for its "
"class. If a class method is called for a derived class, the derived class "
"object is passed as the implied first argument."
msgstr ""
"一個 class method 可以在 class(如 ``C.f()``)或實例(如 ``C().f()``)上呼"
"叫。實例除了它的 class 資訊,其他都會被忽略。如果一個 class method 在 "
"subclass 上呼叫,subclass 會作為第一個引數傳入。"
#: ../../library/functions.rst:275
msgid ""
"Class methods are different than C++ or Java static methods. If you want "
"those, see :func:`staticmethod` in this section. For more information on "
"class methods, see :ref:`types`."
msgstr ""
"Class method 和 C++ 與 Java 的 static method 是有區別的。如果你想瞭解 static "
"method,請看本節的 :func:`staticmethod`。關於 class method 的更多資訊,請參考"
"\\ :ref:`types`。"
#: ../../library/functions.rst:279
msgid ""
"Class methods can now wrap other :term:`descriptors <descriptor>` such as :"
"func:`property`."
msgstr ""
"Class methods 現在可以包裝其他\\ :term:`描述器 <descriptor>`,例如 :func:"
"`property`"
#: ../../library/functions.rst:283
msgid ""
"Class methods now inherit the method attributes (:attr:`~function."
"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :"
"attr:`~function.__doc__` and :attr:`~function.__annotations__`) and have a "
"new ``__wrapped__`` attribute."
msgstr ""
"Class method 現在繼承了 method 屬性(:attr:`~function.__module__`、:attr:"
"`~function.__name__`、:attr:`~function.__qualname__`、:attr:`~function."
"__doc__` 和 :attr:`~function.__annotations__`),並擁有一個新的 "
"``__wrapped__`` 屬性。"
#: ../../library/functions.rst:290
msgid ""
"Class methods can no longer wrap other :term:`descriptors <descriptor>` such "
"as :func:`property`."
msgstr ""
"Class methods 不能再包裝其他的\\ :term:`描述器 <descriptor>`,例如 :func:"
"`property`。"
#: ../../library/functions.rst:297
msgid ""
"Compile the *source* into a code or AST object. Code objects can be "
"executed by :func:`exec` or :func:`eval`. *source* can either be a normal "
"string, a byte string, or an AST object. Refer to the :mod:`ast` module "
"documentation for information on how to work with AST objects."
msgstr ""
"將 *source* 編譯成程式碼或 AST 物件。程式碼物件可以被 :func:`exec` 或 :func:"
"`eval` 執行。*source* 可以是一般的字串、bytes 字串、或者 AST 物件。參見 :mod:"
"`ast` module(模組)的說明文件瞭解如何使用 AST 物件。"
#: ../../library/functions.rst:302
msgid ""
"The *filename* argument should give the file from which the code was read; "
"pass some recognizable value if it wasn't read from a file (``'<string>'`` "
"is commonly used)."
msgstr ""
"*filename* 引數必須是程式碼的檔名;如果程式碼不是從檔案中讀取,可以傳入一些可"
"辨識的值(經常會使用 ``'<string>'`` 來替代)。"
#: ../../library/functions.rst:306
msgid ""
"The *mode* argument specifies what kind of code must be compiled; it can be "
"``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if "
"it consists of a single expression, or ``'single'`` if it consists of a "
"single interactive statement (in the latter case, expression statements that "
"evaluate to something other than ``None`` will be printed)."
msgstr ""
"*mode* 引數指定了編譯程式碼時必須用的模式。如果 *source* 是一系列的陳述式,可"
"以是 ``'exec'``;如果是單一運算式,可以是 ``'eval'``;如果是單個互動式陳述"
"式,可以是 ``'single'``\\ (在最後一種情況下,如果運算式執行結果不是 "
"``None`` 則會被印出來)。"
#: ../../library/functions.rst:312
msgid ""
"The optional arguments *flags* and *dont_inherit* control which :ref:"
"`compiler options <ast-compiler-flags>` should be activated and which :ref:"
"`future features <future>` should be allowed. If neither is present (or both "
"are zero) the code is compiled with the same flags that affect the code that "
"is calling :func:`compile`. If the *flags* argument is given and "
"*dont_inherit* is not (or is zero) then the compiler options and the future "
"statements specified by the *flags* argument are used in addition to those "
"that would be used anyway. If *dont_inherit* is a non-zero integer then the "
"*flags* argument is it -- the flags (future features and compiler options) "
"in the surrounding code are ignored."
msgstr ""
"可選引數 *flags* 和 *dont_inherit* 控制啟用哪個\\ :ref:`編譯器選項 <ast-"
"compiler-flags>`\\ 以及允許哪個\\ :ref:`未來功能 <future>`。如果兩者都不存在"
"(或兩者都為零),則會呼叫與 :func:`compile` 相同旗標的程式碼來編譯。如果給"
"定 *flags* 引數而未給定 *dont_inherit*\\ (或為零)則無論如何都會使用由 "
"*flags* 引數所指定的編譯器選項和未來陳述式。如果 *dont_inherit* 是一個非零整"
"數,則使用 *flags* 引數 -- 周圍程式碼中的旗標(未來功能和編譯器選項)將被忽"
"略。"
#: ../../library/functions.rst:323
msgid ""
"Compiler options and future statements are specified by bits which can be "
"bitwise ORed together to specify multiple options. The bitfield required to "
"specify a given future feature can be found as the :attr:`~__future__."
"_Feature.compiler_flag` attribute on the :class:`~__future__._Feature` "
"instance in the :mod:`__future__` module. :ref:`Compiler flags <ast-compiler-"
"flags>` can be found in :mod:`ast` module, with ``PyCF_`` prefix."
msgstr ""
"編譯器選項和 future 陳述式使用 bits 來表示,可以一起被位元操作 OR 來表示複數"
"個選項。需要被具體定義特徵的位元域可以透過 :mod:`__future__` module 中 :"
"class:`~__future__._Feature` 實例中的 :attr:`~__future__._Feature."
"compiler_flag` 屬性來獲得。:ref:`編譯器旗標 <ast-compiler-flags>`\\ 可以在 :"
"mod:`ast` module 中搜尋有 ``PyCF_`` 前綴的名稱。"
#: ../../library/functions.rst:331
msgid ""
"The argument *optimize* specifies the optimization level of the compiler; "
"the default value of ``-1`` selects the optimization level of the "
"interpreter as given by :option:`-O` options. Explicit levels are ``0`` (no "
"optimization; ``__debug__`` is true), ``1`` (asserts are removed, "
"``__debug__`` is false) or ``2`` (docstrings are removed too)."
msgstr ""
"引數 *optimize* 用來指定編譯器的最佳化級別;預設值 ``-1`` 選擇與直譯器的 :"
"option:`-O` 選項相同的最佳化級別。其他級別為 ``0``\\ (沒有最佳化;\\ "
"``__debug__`` 為真值)、``1``\\ (assert 被刪除,``__debug__`` 為假值)或 "
"``2``\\ (說明字串 (docstring) 也被刪除)。"
#: ../../library/functions.rst:337
msgid ""
"This function raises :exc:`SyntaxError` or :exc:`ValueError` if the compiled "
"source is invalid."
msgstr ""
"如果編譯的原始碼無效,此函式會引發 :exc:`SyntaxError` 或 :exc:`ValueError`。"
#: ../../library/functions.rst:340
msgid ""
"If you want to parse Python code into its AST representation, see :func:`ast."
"parse`."
msgstr "如果你想解析 Python 程式碼為 AST 運算式,請參閱 :func:`ast.parse`。"
#: ../../library/functions.rst:343 ../../library/functions.rst:345
msgid ""
"Raises an :ref:`auditing event <auditing>` ``compile`` with arguments "
"``source`` and ``filename``. This event may also be raised by implicit "
"compilation."
msgstr ""
"引發一個附帶引數 ``source``、``filename`` 的\\ :ref:`稽核事件 <auditing>` "
"``compile``。此事件也可能由隱式編譯 (implicit compilation) 所引發。"
#: ../../library/functions.rst:351
msgid ""
"When compiling a string with multi-line code in ``'single'`` or ``'eval'`` "
"mode, input must be terminated by at least one newline character. This is "
"to facilitate detection of incomplete and complete statements in the :mod:"
"`code` module."
msgstr ""
"在 ``'single'`` 或 ``'eval'`` 模式編譯多行程式碼時,輸入必須以至少一個換行符"
"結尾。這使 :mod:`code` module 更容易檢測陳述式的完整性。"
#: ../../library/functions.rst:358
msgid ""
"It is possible to crash the Python interpreter with a sufficiently large/"
"complex string when compiling to an AST object due to stack depth "
"limitations in Python's AST compiler."
msgstr ""
"如果編譯足夠大或者足夠複雜的字串成 AST 物件時,Python 直譯器會因為 Python "
"AST 編譯器的 stack 深度限制而崩潰。"
#: ../../library/functions.rst:362
msgid ""
"Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode "
"does not have to end in a newline anymore. Added the *optimize* parameter."
msgstr ""
"允許使用 Windows 和 Mac 的換行符號。此外,在 ``'exec'`` 模式不需要以換行符號"
"結尾。增加了 *optimize* 參數。"
#: ../../library/functions.rst:366
msgid ""
"Previously, :exc:`TypeError` was raised when null bytes were encountered in "
"*source*."
msgstr "在之前的版本,*source* 中包含 null bytes 會引發 :exc:`TypeError`。"
#: ../../library/functions.rst:370
msgid ""
"``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable "
"support for top-level ``await``, ``async for``, and ``async with``."
msgstr ""
"``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` 現在可以傳遞旗標以啟用對頂層 ``await``、"
"``async for`` 和 ``async with`` 的支援。"
#: ../../library/functions.rst:379
msgid ""
"Convert a single string or number to a complex number, or create a complex "
"number from real and imaginary parts."
msgstr ""
#: ../../library/functions.rst:382 ../../library/functions.rst:756
#: ../../library/functions.rst:1004
msgid "Examples:"
msgstr "例如: ::"
#: ../../library/functions.rst:384
msgid ""
">>> complex('+1.23')\n"
"(1.23+0j)\n"
">>> complex('-4.5j')\n"
"-4.5j\n"
">>> complex('-1.23+4.5j')\n"
"(-1.23+4.5j)\n"
">>> complex('\\t( -1.23+4.5J )\\n')\n"
"(-1.23+4.5j)\n"
">>> complex('-Infinity+NaNj')\n"
"(-inf+nanj)\n"
">>> complex(1.23)\n"
"(1.23+0j)\n"
">>> complex(imag=-4.5)\n"
"-4.5j\n"
">>> complex(-1.23, 4.5)\n"
"(-1.23+4.5j)"
msgstr ""
">>> complex('+1.23')\n"
"(1.23+0j)\n"
">>> complex('-4.5j')\n"
"-4.5j\n"
">>> complex('-1.23+4.5j')\n"
"(-1.23+4.5j)\n"
">>> complex('\\t( -1.23+4.5J )\\n')\n"
"(-1.23+4.5j)\n"
">>> complex('-Infinity+NaNj')\n"
"(-inf+nanj)\n"
">>> complex(1.23)\n"
"(1.23+0j)\n"
">>> complex(imag=-4.5)\n"
"-4.5j\n"
">>> complex(-1.23, 4.5)\n"
"(-1.23+4.5j)"
#: ../../library/functions.rst:403
msgid ""
"If the argument is a string, it must contain either a real part (in the same "
"format as for :func:`float`) or an imaginary part (in the same format but "
"with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the "
"sign of the imaginary part is mandatory in this case). The string can "
"optionally be surrounded by whitespaces and the round parentheses ``'('`` "
"and ``')'``, which are ignored. The string must not contain whitespace "
"between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal "
"number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` "
"raises :exc:`ValueError`. More precisely, the input must conform to the :"
"token:`~float:complexvalue` production rule in the following grammar, after "
"parentheses and leading and trailing whitespace characters are removed:"
msgstr ""
#: ../../library/functions.rst:422
msgid ""
"If the argument is a number, the constructor serves as a numeric conversion "
"like :class:`int` and :class:`float`. For a general Python object ``x``, "
"``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object."
"__complex__` is not defined then it falls back to :meth:`~object.__float__`. "
"If :meth:`!__float__` is not defined then it falls back to :meth:`~object."
"__index__`."
msgstr ""
"如果引數是一個數字,則建構函式會像 :class:`int` 和 :class:`float` 一樣進行數"