-
-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathoperator.po
More file actions
949 lines (766 loc) · 28.7 KB
/
operator.po
File metadata and controls
949 lines (766 loc) · 28.7 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
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
# Matt Wang <mattwang44@gmail.com>, 2021
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-01 22:24+0800\n"
"PO-Revision-Date: 2023-02-18 14:49+0800\n"
"Last-Translator: Matt Wang <mattwang44@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.2.2\n"
#: ../../library/operator.rst:2
msgid ":mod:`!operator` --- Standard operators as functions"
msgstr ":mod:`!operator` --- 標準運算子替代函式"
#: ../../library/operator.rst:9
msgid "**Source code:** :source:`Lib/operator.py`"
msgstr "**原始碼:**\\ :source:`Lib/operator.py`"
#: ../../library/operator.rst:18
msgid ""
"The :mod:`operator` module exports a set of efficient functions "
"corresponding to the intrinsic operators of Python. For example, "
"``operator.add(x, y)`` is equivalent to the expression ``x+y``. Many "
"function names are those used for special methods, without the double "
"underscores. For backward compatibility, many of these have a variant with "
"the double underscores kept. The variants without the double underscores are "
"preferred for clarity."
msgstr ""
":mod:`operator` module(模組)提供了一套與 Python 原生運算子對應的高效率函"
"式。例如,``operator.add(x, y)`` 與表示式 ``x+y`` 相同。許多函式名與特殊方法"
"名相同,只是沒有雙底線。為了向後相容,許多包含雙底線的函式被保留了下來,但為"
"了易於表達,建議使用沒有雙底線的函式。"
#: ../../library/operator.rst:25
msgid ""
"The functions fall into categories that perform object comparisons, logical "
"operations, mathematical operations and sequence operations."
msgstr "函式種類有物件的比較運算、邏輯運算、數學運算以及序列運算。"
#: ../../library/operator.rst:28
msgid ""
"The object comparison functions are useful for all objects, and are named "
"after the rich comparison operators they support:"
msgstr ""
"物件比較函式適用於所有物件,函式根據它們對應的 rich comparison 運算子命名:"
#: ../../library/operator.rst:45
msgid ""
"Perform \"rich comparisons\" between *a* and *b*. Specifically, ``lt(a, b)`` "
"is equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, "
"``eq(a, b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a !"
"= b``, ``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is "
"equivalent to ``a >= b``. Note that these functions can return any value, "
"which may or may not be interpretable as a Boolean value. "
"See :ref:`comparisons` for more information about rich comparisons."
msgstr ""
"在 *a* 和 *b* 之間進行 \"rich comparison\"。具體來說,``lt(a, b)`` 與 ``a < "
"b`` 相同,``le(a, b)`` 與 ``a <= b`` 相同,``eq(a, b)`` 與 ``a == b`` 相同,"
"``ne(a, b)`` 與 ``a != b`` 相同,``gt(a, b)`` 與 ``a > b`` 相同,``ge(a, "
"b)`` 與 ``a >= b`` 相同。注意這些函式可以回傳任何值,無論它是否可當作 boolean"
"(布林)值。關於 rich comparison 的更多資訊請參考 :ref:`comparisons`。"
#: ../../library/operator.rst:54
msgid ""
"The logical operations are also generally applicable to all objects, and "
"support truth tests, identity tests, and boolean operations:"
msgstr ""
"邏輯運算通常也適用於所有物件,並且支援真值檢測、識別性測試和 boolean 運算:"
#: ../../library/operator.rst:61
msgid ""
"Return the outcome of :keyword:`not` *obj*. (Note that there is no :meth:`!"
"__not__` method for object instances; only the interpreter core defines this "
"operation. The result is affected by the :meth:`~object.__bool__` "
"and :meth:`~object.__len__` methods.)"
msgstr ""
"回傳 :keyword:`not` *obj* 的結果。(請注意物件實例並沒有 :meth:`!__not__` "
"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` "
"和 :meth:`~object.__len__` method 影響。)"
#: ../../library/operator.rst:69
msgid ""
"Return :const:`True` if *obj* is true, and :const:`False` otherwise. This "
"is equivalent to using the :class:`bool` constructor."
msgstr ""
"如果 *obj* 為真值則回傳 :const:`True`,否則回傳 :const:`False`。這等價於使"
"用 :class:`bool` 建構函式。"
#: ../../library/operator.rst:75
msgid "Return ``a is b``. Tests object identity."
msgstr "回傳 ``a is b``。測試物件識別性。"
#: ../../library/operator.rst:80
msgid "Return ``a is not b``. Tests object identity."
msgstr "回傳 ``a is not b``。測試物件識別性。"
#: ../../library/operator.rst:83
msgid "The mathematical and bitwise operations are the most numerous:"
msgstr "數學和位元運算的種類是最多的:"
#: ../../library/operator.rst:89
msgid "Return the absolute value of *obj*."
msgstr "回傳 *obj* 的絕對值。"
#: ../../library/operator.rst:95
msgid "Return ``a + b``, for *a* and *b* numbers."
msgstr "對於數字 *a* 和 *b*,回傳 ``a + b``。"
#: ../../library/operator.rst:101
msgid "Return the bitwise and of *a* and *b*."
msgstr "回傳 *x* 和 *y* 位元運算與 (and) 的結果。"
#: ../../library/operator.rst:107
msgid "Return ``a // b``."
msgstr "回傳 ``a // b``。"
#: ../../library/operator.rst:113
msgid "Return *a* converted to an integer. Equivalent to ``a.__index__()``."
msgstr "回傳 *a* 轉換為整數的結果。等價於 ``a.__index__()``。"
#: ../../library/operator.rst:115
msgid ""
"The result always has exact type :class:`int`. Previously, the result could "
"have been an instance of a subclass of ``int``."
msgstr ""
"結果總是 :class:`int` 型別。在過去的版本中,結果可能為 ``int`` 子類別的實例。"
#: ../../library/operator.rst:125
msgid ""
"Return the bitwise inverse of the number *obj*. This is equivalent to "
"``~obj``."
msgstr "回傳數字 *obj* 按位元取反 (inverse) 的結果。這等價於 ``~obj``。"
#: ../../library/operator.rst:131
msgid "Return *a* shifted left by *b*."
msgstr "回傳 *a* 左移 *b* 位的結果。"
#: ../../library/operator.rst:137
msgid "Return ``a % b``."
msgstr "回傳 ``a % b``。"
#: ../../library/operator.rst:143
msgid "Return ``a * b``, for *a* and *b* numbers."
msgstr "對於數字 *a* 和 *b*,回傳 ``a * b``。"
#: ../../library/operator.rst:149
msgid "Return ``a @ b``."
msgstr "回傳 ``a @ b``。"
#: ../../library/operator.rst:157
msgid "Return *obj* negated (``-obj``)."
msgstr "回傳 *obj* 取負值的結果 (\\ ``-obj``\\ )。"
#: ../../library/operator.rst:163
msgid "Return the bitwise or of *a* and *b*."
msgstr "回傳 *a* 和 *b* 按位元或 (or) 的結果。"
#: ../../library/operator.rst:169
msgid "Return *obj* positive (``+obj``)."
msgstr "回傳 *obj* 取正的結果 (\\ ``+obj``\\ )。"
#: ../../library/operator.rst:175
msgid "Return ``a ** b``, for *a* and *b* numbers."
msgstr "對於數字 *a* 和 *b*,回傳 ``a ** b``。"
#: ../../library/operator.rst:181
msgid "Return *a* shifted right by *b*."
msgstr "回傳 *a* 右移 *b* 位的結果。"
#: ../../library/operator.rst:187
msgid "Return ``a - b``."
msgstr "回傳 ``a - b``。"
#: ../../library/operator.rst:193
msgid ""
"Return ``a / b`` where 2/3 is .66 rather than 0. This is also known as "
"\"true\" division."
msgstr "回傳 ``a / b``,例如 2/3 將等於 .66 而不是 0。這也被稱為「真」除法。"
#: ../../library/operator.rst:200
msgid "Return the bitwise exclusive or of *a* and *b*."
msgstr "回傳 *a* 和 *b* 按位元異或 (exclusive or) 的結果。"
#: ../../library/operator.rst:203
msgid ""
"Operations which work with sequences (some of them with mappings too) "
"include:"
msgstr "適用於序列的操作(其中一些也適用於對映 (mapping)),包括:"
#: ../../library/operator.rst:208
msgid "Return ``a + b`` for *a* and *b* sequences."
msgstr "對於序列 *a* 和 *b*,回傳 ``a + b``。"
#: ../../library/operator.rst:214
msgid "Return the outcome of the test ``b in a``. Note the reversed operands."
msgstr "回傳 ``b in a`` 檢測的結果。請注意運算元是反序的。"
#: ../../library/operator.rst:219
msgid "Return the number of occurrences of *b* in *a*."
msgstr "回傳 *b* 在 *a* 中的出現次數。"
#: ../../library/operator.rst:225
msgid "Remove the value of *a* at index *b*."
msgstr "移除 *a* 中索引為 *b* 的值。"
#: ../../library/operator.rst:231
msgid "Return the value of *a* at index *b*."
msgstr "回傳 *a* 中索引為 *b* 的值。"
#: ../../library/operator.rst:236
msgid "Return the index of the first of occurrence of *b* in *a*."
msgstr "回傳 *b* 在 *a* 中首次出現所在的索引。"
#: ../../library/operator.rst:242
msgid "Set the value of *a* at index *b* to *c*."
msgstr "將 *a* 中索引為 *b* 的值設為 *c*。"
#: ../../library/operator.rst:247
msgid ""
"Return an estimated length for the object *obj*. First try to return its "
"actual length, then an estimate using :meth:`object.__length_hint__`, and "
"finally return the default value."
msgstr ""
"回傳物件 *obj* 的估計長度。首先嘗試回傳其實際長度,再使"
"用 :meth:`object.__length_hint__` 得出估計值,最後才是回傳預設值。"
#: ../../library/operator.rst:254
msgid "The following operation works with callables:"
msgstr "以下操作適用於可呼叫物件:"
#: ../../library/operator.rst:259
msgid "Return ``obj(*args, **kwargs)``."
msgstr "回傳 ``obj(*args, **kwargs)``。"
#: ../../library/operator.rst:264
msgid ""
"The :mod:`operator` module also defines tools for generalized attribute and "
"item lookups. These are useful for making fast field extractors as "
"arguments for :func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or "
"other functions that expect a function argument."
msgstr ""
":mod:`operator` module 還定義了一些用於常規屬性和條目查詢的工具。這些工具適合"
"用來編寫快速欄位提取器以作"
"為 :func:`map`、:func:`sorted`、:meth:`itertools.groupby` 或其他需要函式引數"
"的函式之引數。"
#: ../../library/operator.rst:273
msgid ""
"Return a callable object that fetches *attr* from its operand. If more than "
"one attribute is requested, returns a tuple of attributes. The attribute "
"names can also contain dots. For example:"
msgstr ""
"回傳一個可從運算元中取得 *attr* 的可呼叫 (callable) 物件。如果請求了一個以上"
"的屬性,則回傳一個包含屬性的 tupple(元組)。屬性名稱還可包含點號。例如:"
#: ../../library/operator.rst:277
msgid "After ``f = attrgetter('name')``, the call ``f(b)`` returns ``b.name``."
msgstr "在 ``f = attrgetter('name')`` 之後,呼叫 ``f(b)`` 將回傳 ``b.name``。"
#: ../../library/operator.rst:279
msgid ""
"After ``f = attrgetter('name', 'date')``, the call ``f(b)`` returns "
"``(b.name, b.date)``."
msgstr ""
"在 ``f = attrgetter('name', 'date')`` 之後,呼叫 ``f(b)`` 將回傳 ``(b.name, "
"b.date)``。"
#: ../../library/operator.rst:282
msgid ""
"After ``f = attrgetter('name.first', 'name.last')``, the call ``f(b)`` "
"returns ``(b.name.first, b.name.last)``."
msgstr ""
"在 ``f = attrgetter('name.first', 'name.last')`` 之後,呼叫 ``f(b)`` 將回傳 "
"``(b.name.first, b.name.last)``。"
#: ../../library/operator.rst:285 ../../library/operator.rst:317
#: ../../library/operator.rst:365
msgid "Equivalent to::"
msgstr "等價於: ::"
#: ../../library/operator.rst:287
msgid ""
"def attrgetter(*items):\n"
" if any(not isinstance(item, str) for item in items):\n"
" raise TypeError('attribute name must be a string')\n"
" if len(items) == 1:\n"
" attr = items[0]\n"
" def g(obj):\n"
" return resolve_attr(obj, attr)\n"
" else:\n"
" def g(obj):\n"
" return tuple(resolve_attr(obj, attr) for attr in items)\n"
" return g\n"
"\n"
"def resolve_attr(obj, attr):\n"
" for name in attr.split(\".\"):\n"
" obj = getattr(obj, name)\n"
" return obj"
msgstr ""
"def attrgetter(*items):\n"
" if any(not isinstance(item, str) for item in items):\n"
" raise TypeError('屬性名稱必須是一個字串')\n"
" if len(items) == 1:\n"
" attr = items[0]\n"
" def g(obj):\n"
" return resolve_attr(obj, attr)\n"
" else:\n"
" def g(obj):\n"
" return tuple(resolve_attr(obj, attr) for attr in items)\n"
" return g\n"
"\n"
"def resolve_attr(obj, attr):\n"
" for name in attr.split(\".\"):\n"
" obj = getattr(obj, name)\n"
" return obj"
#: ../../library/operator.rst:308
msgid ""
"Return a callable object that fetches *item* from its operand using the "
"operand's :meth:`~object.__getitem__` method. If multiple items are "
"specified, returns a tuple of lookup values. For example:"
msgstr ""
"回傳一個使用運算元的 :meth:`~object.__getitem__` 方法從運算元中取得 *item* 的"
"可呼叫物件。如果指定了多個條目,則回傳一個查詢值的 tupple。例如:"
#: ../../library/operator.rst:312
msgid "After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``."
msgstr "在 ``f = itemgetter(2)`` 之後,呼叫 ``f(r)`` 將回傳 ``r[2]``。"
#: ../../library/operator.rst:314
msgid ""
"After ``g = itemgetter(2, 5, 3)``, the call ``g(r)`` returns ``(r[2], r[5], "
"r[3])``."
msgstr ""
"在 ``g = itemgetter(2, 5, 3)`` 之後,呼叫 ``g(r)`` 將回傳 ``(r[2], r[5], "
"r[3])``。"
#: ../../library/operator.rst:319
msgid ""
"def itemgetter(*items):\n"
" if len(items) == 1:\n"
" item = items[0]\n"
" def g(obj):\n"
" return obj[item]\n"
" else:\n"
" def g(obj):\n"
" return tuple(obj[item] for item in items)\n"
" return g"
msgstr ""
"def itemgetter(*items):\n"
" if len(items) == 1:\n"
" item = items[0]\n"
" def g(obj):\n"
" return obj[item]\n"
" else:\n"
" def g(obj):\n"
" return tuple(obj[item] for item in items)\n"
" return g"
#: ../../library/operator.rst:329
msgid ""
"The items can be any type accepted by the "
"operand's :meth:`~object.__getitem__` method. Dictionaries accept "
"any :term:`hashable` value. Lists, tuples, and strings accept an index or a "
"slice:"
msgstr ""
"傳入的條目可以為運算元的 :meth:`~object.__getitem__` 所接受的任何型別。"
"dictionary(字典)接受任意\\ :term:`可雜湊 <hashable>`\\ 的值。list、tupple "
"和字串接受索引或切片:"
#: ../../library/operator.rst:343
msgid ""
"Example of using :func:`itemgetter` to retrieve specific fields from a tuple "
"record:"
msgstr "使用 :func:`itemgetter` 從 tuple 中提取特定欄位的例子:"
#: ../../library/operator.rst:356
msgid ""
"Return a callable object that calls the method *name* on its operand. If "
"additional arguments and/or keyword arguments are given, they will be given "
"to the method as well. For example:"
msgstr ""
"回傳一個在運算元上呼叫 *name* method 的可呼叫物件。如果給定額外的引數和/或關"
"鍵字引數,它們也將被傳給該 method。例如:"
#: ../../library/operator.rst:360
msgid ""
"After ``f = methodcaller('name')``, the call ``f(b)`` returns ``b.name()``."
msgstr ""
"在 ``f = methodcaller('name')`` 之後,呼叫 ``f(b)`` 將回傳 ``b.name()``。"
#: ../../library/operator.rst:362
msgid ""
"After ``f = methodcaller('name', 'foo', bar=1)``, the call ``f(b)`` returns "
"``b.name('foo', bar=1)``."
msgstr ""
"在 ``f = methodcaller('name', 'foo', bar=1)`` 之後,呼叫 ``f(b)`` 將回傳 "
"``b.name('foo', bar=1)``。"
#: ../../library/operator.rst:367
msgid ""
"def methodcaller(name, /, *args, **kwargs):\n"
" def caller(obj):\n"
" return getattr(obj, name)(*args, **kwargs)\n"
" return caller"
msgstr ""
"def methodcaller(name, /, *args, **kwargs):\n"
" def caller(obj):\n"
" return getattr(obj, name)(*args, **kwargs)\n"
" return caller"
#: ../../library/operator.rst:376
msgid "Mapping Operators to Functions"
msgstr "運算子與函式間的對映"
#: ../../library/operator.rst:378
msgid ""
"This table shows how abstract operations correspond to operator symbols in "
"the Python syntax and the functions in the :mod:`operator` module."
msgstr ""
"以下表格表示了抽象運算是如何對應於 Python 語法中的運算子和 :mod:`operator` "
"module中的函式。"
#: ../../library/operator.rst:382
msgid "Operation"
msgstr "運算"
#: ../../library/operator.rst:382
msgid "Syntax"
msgstr "語法"
#: ../../library/operator.rst:382
msgid "Function"
msgstr "函式"
#: ../../library/operator.rst:384
msgid "Addition"
msgstr "加法"
#: ../../library/operator.rst:384
msgid "``a + b``"
msgstr "``a + b``"
#: ../../library/operator.rst:384
msgid "``add(a, b)``"
msgstr "``add(a, b)``"
#: ../../library/operator.rst:386
msgid "Concatenation"
msgstr "字串串接"
#: ../../library/operator.rst:386
msgid "``seq1 + seq2``"
msgstr "``seq1 + seq2``"
#: ../../library/operator.rst:386
msgid "``concat(seq1, seq2)``"
msgstr "``concat(seq1, seq2)``"
#: ../../library/operator.rst:388
msgid "Containment Test"
msgstr "包含性檢測"
#: ../../library/operator.rst:388
msgid "``obj in seq``"
msgstr "``obj in seq``"
#: ../../library/operator.rst:388
msgid "``contains(seq, obj)``"
msgstr "``contains(seq, obj)``"
#: ../../library/operator.rst:390 ../../library/operator.rst:392
msgid "Division"
msgstr "除法"
#: ../../library/operator.rst:390
msgid "``a / b``"
msgstr "``a / b``"
#: ../../library/operator.rst:390
msgid "``truediv(a, b)``"
msgstr "``truediv(a, b)``"
#: ../../library/operator.rst:392
msgid "``a // b``"
msgstr "``a // b``"
#: ../../library/operator.rst:392
msgid "``floordiv(a, b)``"
msgstr "``floordiv(a, b)``"
#: ../../library/operator.rst:394
msgid "Bitwise And"
msgstr "按位元與 (And)"
#: ../../library/operator.rst:394
msgid "``a & b``"
msgstr "``a & b``"
#: ../../library/operator.rst:394
msgid "``and_(a, b)``"
msgstr "``and_(a, b)``"
#: ../../library/operator.rst:396
msgid "Bitwise Exclusive Or"
msgstr "按位元互斥或 (Exclusive Or)"
#: ../../library/operator.rst:396
msgid "``a ^ b``"
msgstr "``a ^ b``"
#: ../../library/operator.rst:396
msgid "``xor(a, b)``"
msgstr "``xor(a, b)``"
#: ../../library/operator.rst:398
msgid "Bitwise Inversion"
msgstr "按位元取反 (Inversion)"
#: ../../library/operator.rst:398
msgid "``~ a``"
msgstr "``~ a``"
#: ../../library/operator.rst:398
msgid "``invert(a)``"
msgstr "``invert(a)``"
#: ../../library/operator.rst:400
msgid "Bitwise Or"
msgstr "按位元或 (Or)"
#: ../../library/operator.rst:400
msgid "``a | b``"
msgstr "``a | b``"
#: ../../library/operator.rst:400
msgid "``or_(a, b)``"
msgstr "``or_(a, b)``"
#: ../../library/operator.rst:402
msgid "Exponentiation"
msgstr "取冪"
#: ../../library/operator.rst:402
msgid "``a ** b``"
msgstr "``a ** b``"
#: ../../library/operator.rst:402
msgid "``pow(a, b)``"
msgstr "``pow(a, b)``"
#: ../../library/operator.rst:404 ../../library/operator.rst:406
msgid "Identity"
msgstr "識別性"
#: ../../library/operator.rst:404
msgid "``a is b``"
msgstr "``a is b``"
#: ../../library/operator.rst:404
msgid "``is_(a, b)``"
msgstr "``is_(a, b)``"
#: ../../library/operator.rst:406
msgid "``a is not b``"
msgstr "``a is not b``"
#: ../../library/operator.rst:406
msgid "``is_not(a, b)``"
msgstr "``is_not(a, b)``"
#: ../../library/operator.rst:408
msgid "Indexed Assignment"
msgstr "索引賦值"
#: ../../library/operator.rst:408
msgid "``obj[k] = v``"
msgstr "``obj[k] = v``"
#: ../../library/operator.rst:408
msgid "``setitem(obj, k, v)``"
msgstr "``setitem(obj, k, v)``"
#: ../../library/operator.rst:410
msgid "Indexed Deletion"
msgstr "索引刪除"
#: ../../library/operator.rst:410
msgid "``del obj[k]``"
msgstr "``del obj[k]``"
#: ../../library/operator.rst:410
msgid "``delitem(obj, k)``"
msgstr "``delitem(obj, k)``"
#: ../../library/operator.rst:412
msgid "Indexing"
msgstr "索引取值"
#: ../../library/operator.rst:412
msgid "``obj[k]``"
msgstr "``obj[k]``"
#: ../../library/operator.rst:412
msgid "``getitem(obj, k)``"
msgstr "``getitem(obj, k)``"
#: ../../library/operator.rst:414
msgid "Left Shift"
msgstr "左移"
#: ../../library/operator.rst:414
msgid "``a << b``"
msgstr "``a << b``"
#: ../../library/operator.rst:414
msgid "``lshift(a, b)``"
msgstr "``lshift(a, b)``"
#: ../../library/operator.rst:416
msgid "Modulo"
msgstr "模除 (Modulo)"
#: ../../library/operator.rst:416
msgid "``a % b``"
msgstr "``a % b``"
#: ../../library/operator.rst:416
msgid "``mod(a, b)``"
msgstr "``mod(a, b)``"
#: ../../library/operator.rst:418
msgid "Multiplication"
msgstr "乘法"
#: ../../library/operator.rst:418
msgid "``a * b``"
msgstr "``a * b``"
#: ../../library/operator.rst:418
msgid "``mul(a, b)``"
msgstr "``mul(a, b)``"
#: ../../library/operator.rst:420
msgid "Matrix Multiplication"
msgstr "矩陣乘法"
#: ../../library/operator.rst:420
msgid "``a @ b``"
msgstr "``a @ b``"
#: ../../library/operator.rst:420
msgid "``matmul(a, b)``"
msgstr "``matmul(a, b)``"
#: ../../library/operator.rst:422
msgid "Negation (Arithmetic)"
msgstr "反相(算術)"
#: ../../library/operator.rst:422
msgid "``- a``"
msgstr "``- a``"
#: ../../library/operator.rst:422
msgid "``neg(a)``"
msgstr "``neg(a)``"
#: ../../library/operator.rst:424
msgid "Negation (Logical)"
msgstr "反相(邏輯)"
#: ../../library/operator.rst:424
msgid "``not a``"
msgstr "``not a``"
#: ../../library/operator.rst:424
msgid "``not_(a)``"
msgstr "``not_(a)``"
#: ../../library/operator.rst:426
msgid "Positive"
msgstr "正數"
#: ../../library/operator.rst:426
msgid "``+ a``"
msgstr "``+ a``"
#: ../../library/operator.rst:426
msgid "``pos(a)``"
msgstr "``pos(a)``"
#: ../../library/operator.rst:428
msgid "Right Shift"
msgstr "右移"
#: ../../library/operator.rst:428
msgid "``a >> b``"
msgstr "``a >> b``"
#: ../../library/operator.rst:428
msgid "``rshift(a, b)``"
msgstr "``rshift(a, b)``"
#: ../../library/operator.rst:430
msgid "Slice Assignment"
msgstr "切片賦值"
#: ../../library/operator.rst:430
msgid "``seq[i:j] = values``"
msgstr "``seq[i:j] = values``"
#: ../../library/operator.rst:430
msgid "``setitem(seq, slice(i, j), values)``"
msgstr "``setitem(seq, slice(i, j), values)``"
#: ../../library/operator.rst:432
msgid "Slice Deletion"
msgstr "切片刪除"
#: ../../library/operator.rst:432
msgid "``del seq[i:j]``"
msgstr "``del seq[i:j]``"
#: ../../library/operator.rst:432
msgid "``delitem(seq, slice(i, j))``"
msgstr "``delitem(seq, slice(i, j))``"
#: ../../library/operator.rst:434
msgid "Slicing"
msgstr "切片取值"
#: ../../library/operator.rst:434
msgid "``seq[i:j]``"
msgstr "``seq[i:j]``"
#: ../../library/operator.rst:434
msgid "``getitem(seq, slice(i, j))``"
msgstr "``getitem(seq, slice(i, j))``"
#: ../../library/operator.rst:436
msgid "String Formatting"
msgstr "字串格式化"
#: ../../library/operator.rst:436
msgid "``s % obj``"
msgstr "``s % obj``"
#: ../../library/operator.rst:436
msgid "``mod(s, obj)``"
msgstr "``mod(s, obj)``"
#: ../../library/operator.rst:438
msgid "Subtraction"
msgstr "減法"
#: ../../library/operator.rst:438
msgid "``a - b``"
msgstr "``a - b``"
#: ../../library/operator.rst:438
msgid "``sub(a, b)``"
msgstr "``sub(a, b)``"
#: ../../library/operator.rst:440
msgid "Truth Test"
msgstr "真值檢測"
#: ../../library/operator.rst:440
msgid "``obj``"
msgstr "``obj``"
#: ../../library/operator.rst:440
msgid "``truth(obj)``"
msgstr "``truth(obj)``"
#: ../../library/operator.rst:442 ../../library/operator.rst:444
#: ../../library/operator.rst:450 ../../library/operator.rst:452
msgid "Ordering"
msgstr "比較大小"
#: ../../library/operator.rst:442
msgid "``a < b``"
msgstr "``a < b``"
#: ../../library/operator.rst:442
msgid "``lt(a, b)``"
msgstr "``lt(a, b)``"
#: ../../library/operator.rst:444
msgid "``a <= b``"
msgstr "``a <= b``"
#: ../../library/operator.rst:444
msgid "``le(a, b)``"
msgstr "``le(a, b)``"
#: ../../library/operator.rst:446
msgid "Equality"
msgstr "相等性"
#: ../../library/operator.rst:446
msgid "``a == b``"
msgstr "``a == b``"
#: ../../library/operator.rst:446
msgid "``eq(a, b)``"
msgstr "``eq(a, b)``"
#: ../../library/operator.rst:448
msgid "Difference"
msgstr "不等性"
#: ../../library/operator.rst:448
msgid "``a != b``"
msgstr "``a != b``"
#: ../../library/operator.rst:448
msgid "``ne(a, b)``"
msgstr "``ne(a, b)``"
#: ../../library/operator.rst:450
msgid "``a >= b``"
msgstr "``a >= b``"
#: ../../library/operator.rst:450
msgid "``ge(a, b)``"
msgstr "``ge(a, b)``"
#: ../../library/operator.rst:452
msgid "``a > b``"
msgstr "``a > b``"
#: ../../library/operator.rst:452
msgid "``gt(a, b)``"
msgstr "``gt(a, b)``"
#: ../../library/operator.rst:456
msgid "In-place Operators"
msgstr "原地 (in-place) 運算子"
#: ../../library/operator.rst:458
msgid ""
"Many operations have an \"in-place\" version. Listed below are functions "
"providing a more primitive access to in-place operators than the usual "
"syntax does; for example, the :term:`statement` ``x += y`` is equivalent to "
"``x = operator.iadd(x, y)``. Another way to put it is to say that ``z = "
"operator.iadd(x, y)`` is equivalent to the compound statement ``z = x; z += "
"y``."
msgstr ""
"許多運算都有「原地」版本。以下列出的是提供對原地運算子(與一般語法相比)更底"
"層存取的函式,例如 :term:`statement` ``x += y`` 相當於 ``x = "
"operator.iadd(x, y)``。換一種方式來講就是 ``z = operator.iadd(x, y)`` 等價於"
"複合陳述式 ``z = x; z += y``。"
#: ../../library/operator.rst:465
msgid ""
"In those examples, note that when an in-place method is called, the "
"computation and assignment are performed in two separate steps. The in-"
"place functions listed below only do the first step, calling the in-place "
"method. The second step, assignment, is not handled."
msgstr ""
"在這些例子中,請注意當呼叫一個原地方法時,運算和賦值是分成兩個步驟來執行的。"
"下面列出的原地函式只執行第一步,即呼叫原地方法,第二步賦值則不加處理。"
#: ../../library/operator.rst:470
msgid ""
"For immutable targets such as strings, numbers, and tuples, the updated "
"value is computed, but not assigned back to the input variable:"
msgstr ""
"對於不可變 (immutable) 的目標例如字串、數字和 tupple,更新的值會被計算,但不"
"會被再被賦值給輸入變數:"
#: ../../library/operator.rst:479
msgid ""
"For mutable targets such as lists and dictionaries, the in-place method will "
"perform the update, so no subsequent assignment is necessary:"
msgstr ""
"對於可變 (mutable) 的目標例如 list 和 dictionary,原地方法將執行更新,因此不"
"需要後續賦值操作:"
#: ../../library/operator.rst:491
msgid "``a = iadd(a, b)`` is equivalent to ``a += b``."
msgstr "``a = iadd(a, b)`` 等價於 ``a += b``。"
#: ../../library/operator.rst:497
msgid "``a = iand(a, b)`` is equivalent to ``a &= b``."
msgstr "``a = iand(a, b)`` 等價於 ``a &= b``。"
#: ../../library/operator.rst:503
msgid ""
"``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences."
msgstr "``a = iconcat(a, b)`` 等價於 ``a += b``,其中 *a* 和 *b* 為序列。"
#: ../../library/operator.rst:509
msgid "``a = ifloordiv(a, b)`` is equivalent to ``a //= b``."
msgstr "``a = ifloordiv(a, b)`` 等價於 ``a //= b``。"
#: ../../library/operator.rst:515
msgid "``a = ilshift(a, b)`` is equivalent to ``a <<= b``."
msgstr "``a = ilshift(a, b)`` 等價於 ``a <<= b``。"
#: ../../library/operator.rst:521
msgid "``a = imod(a, b)`` is equivalent to ``a %= b``."
msgstr "``a = imod(a, b)`` 等價於 ``a %= b``。"
#: ../../library/operator.rst:527
msgid "``a = imul(a, b)`` is equivalent to ``a *= b``."
msgstr "``a = imul(a, b)`` 等價於 ``a *= b``。"
#: ../../library/operator.rst:533
msgid "``a = imatmul(a, b)`` is equivalent to ``a @= b``."
msgstr "``a = imatmul(a, b)`` 等價於 ``a @= b``。"
#: ../../library/operator.rst:541
msgid "``a = ior(a, b)`` is equivalent to ``a |= b``."
msgstr "``a = ior(a, b)`` 等價於 ``a |= b``。"
#: ../../library/operator.rst:547
msgid "``a = ipow(a, b)`` is equivalent to ``a **= b``."
msgstr "``a = ipow(a, b)`` 等價於 ``a **= b``。"
#: ../../library/operator.rst:553
msgid "``a = irshift(a, b)`` is equivalent to ``a >>= b``."
msgstr "``a = irshift(a, b)`` 等價於 ``a >>= b``。"
#: ../../library/operator.rst:559
msgid "``a = isub(a, b)`` is equivalent to ``a -= b``."
msgstr "``a = isub(a, b)`` 等價於 ``a -= b``。"
#: ../../library/operator.rst:565
msgid "``a = itruediv(a, b)`` is equivalent to ``a /= b``."
msgstr "``a = itruediv(a, b)`` 等價於 ``a /= b``。"
#: ../../library/operator.rst:571
msgid "``a = ixor(a, b)`` is equivalent to ``a ^= b``."
msgstr "``a = ixor(a, b)`` 等價於 ``a ^= b``。"