Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5b9da9c

Browse files
authoredJul 18, 2023
sync with cpython a7acc5cb
1 parent 97f6ea0 commit 5b9da9c

File tree

1 file changed

+122
-121
lines changed

1 file changed

+122
-121
lines changed
 

‎tutorial/controlflow.po

Lines changed: 122 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: Python 3.11\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2023-07-12 00:20+0000\n"
14+
"POT-Creation-Date: 2023-07-18 00:46+0000\n"
1515
"PO-Revision-Date: 2022-07-24 14:52+0800\n"
1616
"Last-Translator: Steven Hsu <hsuhaochun@gmail.com>\n"
1717
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -395,16 +395,17 @@ msgstr ""
395395
"``Point``)則永遠無法被賦值。"
396396

397397
#: ../../tutorial/controlflow.rst:345
398+
#, fuzzy
398399
msgid ""
399400
"Patterns can be arbitrarily nested. For example, if we have a short list of "
400-
"points, we could match it like this::"
401+
"Points, with ``__match_args__`` added, we could match it like this::"
401402
msgstr ""
402403
"模式可以任意地被巢套 (nested)。例如,如果我們有一個由某些點所組成的簡短 "
403404
"list,我們就可以像這樣來對它進行匹配:\n"
404405
"\n"
405406
"::"
406407

407-
#: ../../tutorial/controlflow.rst:360
408+
#: ../../tutorial/controlflow.rst:366
408409
msgid ""
409410
"We can add an ``if`` clause to a pattern, known as a \"guard\". If the "
410411
"guard is false, ``match`` goes on to try the next case block. Note that "
@@ -416,11 +417,11 @@ msgstr ""
416417
"\n"
417418
"::"
418419

419-
#: ../../tutorial/controlflow.rst:370
420+
#: ../../tutorial/controlflow.rst:376
420421
msgid "Several other key features of this statement:"
421422
msgstr "此種陳述式的其他幾個重要特色:"
422423

423-
#: ../../tutorial/controlflow.rst:372
424+
#: ../../tutorial/controlflow.rst:378
424425
msgid ""
425426
"Like unpacking assignments, tuple and list patterns have exactly the same "
426427
"meaning and actually match arbitrary sequences. An important exception is "
@@ -429,7 +430,7 @@ msgstr ""
429430
"與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上"
430431
"可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。"
431432

432-
#: ../../tutorial/controlflow.rst:376
433+
#: ../../tutorial/controlflow.rst:382
433434
msgid ""
434435
"Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, "
435436
"*rest)`` work similar to unpacking assignments. The name after ``*`` may "
@@ -441,7 +442,7 @@ msgstr ""
441442
"是 ``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外"
442443
"的其餘項。"
443444

444-
#: ../../tutorial/controlflow.rst:381
445+
#: ../../tutorial/controlflow.rst:387
445446
msgid ""
446447
"Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the "
447448
"``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike "
@@ -453,30 +454,30 @@ msgstr ""
453454
"模式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支"
454455
"援的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)"
455456

456-
#: ../../tutorial/controlflow.rst:386
457+
#: ../../tutorial/controlflow.rst:392
457458
msgid "Subpatterns may be captured using the ``as`` keyword::"
458459
msgstr ""
459460
"使用關鍵字 ``as`` 可以擷取子模式 (subpattern):\n"
460461
"\n"
461462
"::"
462463

463-
#: ../../tutorial/controlflow.rst:390
464+
#: ../../tutorial/controlflow.rst:396
464465
msgid ""
465466
"will capture the second element of the input as ``p2`` (as long as the input "
466467
"is a sequence of two points)"
467468
msgstr ""
468469
"將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序"
469470
"列)。"
470471

471-
#: ../../tutorial/controlflow.rst:393
472+
#: ../../tutorial/controlflow.rst:399
472473
msgid ""
473474
"Most literals are compared by equality, however the singletons ``True``, "
474475
"``False`` and ``None`` are compared by identity."
475476
msgstr ""
476477
"大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) "
477478
"``True``\\\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。"
478479

479-
#: ../../tutorial/controlflow.rst:396
480+
#: ../../tutorial/controlflow.rst:402
480481
msgid ""
481482
"Patterns may use named constants. These must be dotted names to prevent "
482483
"them from being interpreted as capture variable::"
@@ -486,18 +487,18 @@ msgstr ""
486487
"\n"
487488
"::"
488489

489-
#: ../../tutorial/controlflow.rst:415
490+
#: ../../tutorial/controlflow.rst:421
490491
msgid ""
491492
"For a more detailed explanation and additional examples, you can look into :"
492493
"pep:`636` which is written in a tutorial format."
493494
msgstr ""
494495
"關於更詳細的解釋和其他範例,你可以閱讀 :pep:`636`,它是以教學的格式編寫而成。"
495496

496-
#: ../../tutorial/controlflow.rst:421
497+
#: ../../tutorial/controlflow.rst:427
497498
msgid "Defining Functions"
498499
msgstr "定義函式 (function)"
499500

500-
#: ../../tutorial/controlflow.rst:423
501+
#: ../../tutorial/controlflow.rst:429
501502
msgid ""
502503
"We can create a function that writes the Fibonacci series to an arbitrary "
503504
"boundary::"
@@ -506,7 +507,7 @@ msgstr ""
506507
"\n"
507508
"::"
508509

509-
#: ../../tutorial/controlflow.rst:443
510+
#: ../../tutorial/controlflow.rst:449
510511
msgid ""
511512
"The keyword :keyword:`def` introduces a function *definition*. It must be "
512513
"followed by the function name and the parenthesized list of formal "
@@ -516,7 +517,7 @@ msgstr ""
516517
"關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*\\ 。它之後必須連著該函式的名稱"
517518
"和置於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。"
518519

519-
#: ../../tutorial/controlflow.rst:448
520+
#: ../../tutorial/controlflow.rst:454
520521
msgid ""
521522
"The first statement of the function body can optionally be a string literal; "
522523
"this string literal is the function's documentation string, or :dfn:"
@@ -532,7 +533,7 @@ msgstr ""
532533
"件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個"
533534
"好慣例,應該養成這樣的習慣。"
534535

535-
#: ../../tutorial/controlflow.rst:455
536+
#: ../../tutorial/controlflow.rst:461
536537
msgid ""
537538
"The *execution* of a function introduces a new symbol table used for the "
538539
"local variables of the function. More precisely, all variable assignments "
@@ -553,7 +554,7 @@ msgstr ""
553554
"域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:"
554555
"`nonlocal` 陳述式中被定義)。"
555556

556-
#: ../../tutorial/controlflow.rst:466
557+
#: ../../tutorial/controlflow.rst:472
557558
msgid ""
558559
"The actual parameters (arguments) to a function call are introduced in the "
559560
"local symbol table of the called function when it is called; thus, arguments "
@@ -568,7 +569,7 @@ msgstr ""
568569
"函式呼叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號"
569570
"表。"
570571

571-
#: ../../tutorial/controlflow.rst:473
572+
#: ../../tutorial/controlflow.rst:479
572573
msgid ""
573574
"A function definition associates the function name with the function object "
574575
"in the current symbol table. The interpreter recognizes the object pointed "
@@ -581,7 +582,7 @@ msgstr ""
581582
"\n"
582583
"::"
583584

584-
#: ../../tutorial/controlflow.rst:484
585+
#: ../../tutorial/controlflow.rst:490
585586
msgid ""
586587
"Coming from other languages, you might object that ``fib`` is not a function "
587588
"but a procedure since it doesn't return a value. In fact, even functions "
@@ -598,7 +599,7 @@ msgstr ""
598599
"\n"
599600
"::"
600601

601-
#: ../../tutorial/controlflow.rst:495
602+
#: ../../tutorial/controlflow.rst:501
602603
msgid ""
603604
"It is simple to write a function that returns a list of the numbers of the "
604605
"Fibonacci series, instead of printing it::"
@@ -607,11 +608,11 @@ msgstr ""
607608
"\n"
608609
"::"
609610

610-
#: ../../tutorial/controlflow.rst:511
611+
#: ../../tutorial/controlflow.rst:517
611612
msgid "This example, as usual, demonstrates some new Python features:"
612613
msgstr "這個例子一樣示範了一些新的 Python 特性:"
613614

614-
#: ../../tutorial/controlflow.rst:513
615+
#: ../../tutorial/controlflow.rst:519
615616
msgid ""
616617
"The :keyword:`return` statement returns with a value from a function. :"
617618
"keyword:`!return` without an expression argument returns ``None``. Falling "
@@ -621,7 +622,7 @@ msgstr ""
621622
"不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 "
622623
"``None``\\ 。"
623624

624-
#: ../../tutorial/controlflow.rst:517
625+
#: ../../tutorial/controlflow.rst:523
625626
msgid ""
626627
"The statement ``result.append(a)`` calls a *method* of the list object "
627628
"``result``. A method is a function that 'belongs' to an object and is named "
@@ -643,22 +644,22 @@ msgstr ""
643644
"method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同"
644645
"於 ``result = result + [a]``\\ ,但更有效率。"
645646

646-
#: ../../tutorial/controlflow.rst:532
647+
#: ../../tutorial/controlflow.rst:538
647648
msgid "More on Defining Functions"
648649
msgstr "深入了解函式定義"
649650

650-
#: ../../tutorial/controlflow.rst:534
651+
#: ../../tutorial/controlflow.rst:540
651652
msgid ""
652653
"It is also possible to define functions with a variable number of arguments. "
653654
"There are three forms, which can be combined."
654655
msgstr ""
655656
"定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。"
656657

657-
#: ../../tutorial/controlflow.rst:541
658+
#: ../../tutorial/controlflow.rst:547
658659
msgid "Default Argument Values"
659660
msgstr "預設引數值"
660661

661-
#: ../../tutorial/controlflow.rst:543
662+
#: ../../tutorial/controlflow.rst:549
662663
msgid ""
663664
"The most useful form is to specify a default value for one or more "
664665
"arguments. This creates a function that can be called with fewer arguments "
@@ -669,37 +670,37 @@ msgstr ""
669670
"\n"
670671
"::"
671672

672-
#: ../../tutorial/controlflow.rst:559
673+
#: ../../tutorial/controlflow.rst:565
673674
msgid "This function can be called in several ways:"
674675
msgstr "該函式可以用以下幾種方式被呼叫:"
675676

676-
#: ../../tutorial/controlflow.rst:561
677+
#: ../../tutorial/controlflow.rst:567
677678
msgid ""
678679
"giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``"
679680
msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``"
680681

681-
#: ../../tutorial/controlflow.rst:563
682+
#: ../../tutorial/controlflow.rst:569
682683
msgid ""
683684
"giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', "
684685
"2)``"
685686
msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``"
686687

687-
#: ../../tutorial/controlflow.rst:565
688+
#: ../../tutorial/controlflow.rst:571
688689
msgid ""
689690
"or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come "
690691
"on, only yes or no!')``"
691692
msgstr ""
692693
"給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes "
693694
"or no!')``"
694695

695-
#: ../../tutorial/controlflow.rst:568
696+
#: ../../tutorial/controlflow.rst:574
696697
msgid ""
697698
"This example also introduces the :keyword:`in` keyword. This tests whether "
698699
"or not a sequence contains a certain value."
699700
msgstr ""
700701
"此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。"
701702

702-
#: ../../tutorial/controlflow.rst:571
703+
#: ../../tutorial/controlflow.rst:577
703704
msgid ""
704705
"The default values are evaluated at the point of function definition in the "
705706
"*defining* scope, so that ::"
@@ -708,11 +709,11 @@ msgstr ""
708709
"\n"
709710
"::"
710711

711-
#: ../../tutorial/controlflow.rst:582
712+
#: ../../tutorial/controlflow.rst:588
712713
msgid "will print ``5``."
713714
msgstr "將會輸出 ``5``\\ 。"
714715

715-
#: ../../tutorial/controlflow.rst:584
716+
#: ../../tutorial/controlflow.rst:590
716717
msgid ""
717718
"**Important warning:** The default value is evaluated only once. This makes "
718719
"a difference when the default is a mutable object such as a list, "
@@ -725,24 +726,24 @@ msgstr ""
725726
"\n"
726727
"::"
727728

728-
#: ../../tutorial/controlflow.rst:597
729+
#: ../../tutorial/controlflow.rst:603
729730
msgid "This will print ::"
730731
msgstr ""
731732
"將會輸出:\n"
732733
"\n"
733734
"::"
734735

735-
#: ../../tutorial/controlflow.rst:603
736+
#: ../../tutorial/controlflow.rst:609
736737
msgid ""
737738
"If you don't want the default to be shared between subsequent calls, you can "
738739
"write the function like this instead::"
739740
msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:"
740741

741-
#: ../../tutorial/controlflow.rst:616
742+
#: ../../tutorial/controlflow.rst:622
742743
msgid "Keyword Arguments"
743744
msgstr "關鍵字引數"
744745

745-
#: ../../tutorial/controlflow.rst:618
746+
#: ../../tutorial/controlflow.rst:624
746747
msgid ""
747748
"Functions can also be called using :term:`keyword arguments <keyword "
748749
"argument>` of the form ``kwarg=value``. For instance, the following "
@@ -753,7 +754,7 @@ msgstr ""
753754
"\n"
754755
"::"
755756

756-
#: ../../tutorial/controlflow.rst:627
757+
#: ../../tutorial/controlflow.rst:633
757758
msgid ""
758759
"accepts one required argument (``voltage``) and three optional arguments "
759760
"(``state``, ``action``, and ``type``). This function can be called in any "
@@ -764,14 +765,14 @@ msgstr ""
764765
"\n"
765766
"::"
766767

767-
#: ../../tutorial/controlflow.rst:638
768+
#: ../../tutorial/controlflow.rst:644
768769
msgid "but all the following calls would be invalid::"
769770
msgstr ""
770771
"但以下呼叫方式都無效:\n"
771772
"\n"
772773
"::"
773774

774-
#: ../../tutorial/controlflow.rst:645
775+
#: ../../tutorial/controlflow.rst:651
775776
msgid ""
776777
"In a function call, keyword arguments must follow positional arguments. All "
777778
"the keyword arguments passed must match one of the arguments accepted by the "
@@ -789,7 +790,7 @@ msgstr ""
789790
"\n"
790791
"::"
791792

792-
#: ../../tutorial/controlflow.rst:661
793+
#: ../../tutorial/controlflow.rst:667
793794
msgid ""
794795
"When a final formal parameter of the form ``**name`` is present, it receives "
795796
"a dictionary (see :ref:`typesmapping`) containing all keyword arguments "
@@ -807,31 +808,31 @@ msgstr ""
807808
"\n"
808809
"::"
809810

810-
#: ../../tutorial/controlflow.rst:678
811+
#: ../../tutorial/controlflow.rst:684
811812
msgid "It could be called like this::"
812813
msgstr ""
813814
"它可以被如此呼叫:\n"
814815
"\n"
815816
"::"
816817

817-
#: ../../tutorial/controlflow.rst:686
818+
#: ../../tutorial/controlflow.rst:692
818819
msgid "and of course it would print:"
819820
msgstr ""
820821
"輸出結果如下:\n"
821822
"\n"
822823
"::"
823824

824-
#: ../../tutorial/controlflow.rst:699
825+
#: ../../tutorial/controlflow.rst:705
825826
msgid ""
826827
"Note that the order in which the keyword arguments are printed is guaranteed "
827828
"to match the order in which they were provided in the function call."
828829
msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。"
829830

830-
#: ../../tutorial/controlflow.rst:703
831+
#: ../../tutorial/controlflow.rst:709
831832
msgid "Special parameters"
832833
msgstr "特殊參數"
833834

834-
#: ../../tutorial/controlflow.rst:705
835+
#: ../../tutorial/controlflow.rst:711
835836
msgid ""
836837
"By default, arguments may be passed to a Python function either by position "
837838
"or explicitly by keyword. For readability and performance, it makes sense to "
@@ -843,11 +844,11 @@ msgstr ""
843844
"及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各"
844845
"項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。"
845846

846-
#: ../../tutorial/controlflow.rst:711
847+
#: ../../tutorial/controlflow.rst:717
847848
msgid "A function definition may look like:"
848849
msgstr "函式定義可能如以下樣式:"
849850

850-
#: ../../tutorial/controlflow.rst:722
851+
#: ../../tutorial/controlflow.rst:728
851852
msgid ""
852853
"where ``/`` and ``*`` are optional. If used, these symbols indicate the kind "
853854
"of parameter by how the arguments may be passed to the function: positional-"
@@ -858,22 +859,22 @@ msgstr ""
858859
"類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named "
859860
"parameters)。"
860861

861-
#: ../../tutorial/controlflow.rst:729
862+
#: ../../tutorial/controlflow.rst:735
862863
msgid "Positional-or-Keyword Arguments"
863864
msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)"
864865

865-
#: ../../tutorial/controlflow.rst:731
866+
#: ../../tutorial/controlflow.rst:737
866867
msgid ""
867868
"If ``/`` and ``*`` are not present in the function definition, arguments may "
868869
"be passed to a function by position or by keyword."
869870
msgstr ""
870871
"若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。"
871872

872-
#: ../../tutorial/controlflow.rst:736
873+
#: ../../tutorial/controlflow.rst:742
873874
msgid "Positional-Only Parameters"
874875
msgstr "僅限位置參數 (Positional-Only Parameters)"
875876

876-
#: ../../tutorial/controlflow.rst:738
877+
#: ../../tutorial/controlflow.rst:744
877878
msgid ""
878879
"Looking at this in a bit more detail, it is possible to mark certain "
879880
"parameters as *positional-only*. If *positional-only*, the parameters' order "
@@ -888,17 +889,17 @@ msgstr ""
888889
"``/``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函"
889890
"式定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。"
890891

891-
#: ../../tutorial/controlflow.rst:746
892+
#: ../../tutorial/controlflow.rst:752
892893
msgid ""
893894
"Parameters following the ``/`` may be *positional-or-keyword* or *keyword-"
894895
"only*."
895896
msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\\\ *僅限關鍵字*\\ 參數。"
896897

897-
#: ../../tutorial/controlflow.rst:750
898+
#: ../../tutorial/controlflow.rst:756
898899
msgid "Keyword-Only Arguments"
899900
msgstr "僅限關鍵字引數 (Keyword-Only Arguments)"
900901

901-
#: ../../tutorial/controlflow.rst:752
902+
#: ../../tutorial/controlflow.rst:758
902903
msgid ""
903904
"To mark parameters as *keyword-only*, indicating the parameters must be "
904905
"passed by keyword argument, place an ``*`` in the arguments list just before "
@@ -907,11 +908,11 @@ msgstr ""
907908
"要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列"
908909
"表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。"
909910

910-
#: ../../tutorial/controlflow.rst:758
911+
#: ../../tutorial/controlflow.rst:764
911912
msgid "Function Examples"
912913
msgstr "函式範例"
913914

914-
#: ../../tutorial/controlflow.rst:760
915+
#: ../../tutorial/controlflow.rst:766
915916
msgid ""
916917
"Consider the following example function definitions paying close attention "
917918
"to the markers ``/`` and ``*``::"
@@ -920,7 +921,7 @@ msgstr ""
920921
"\n"
921922
"::"
922923

923-
#: ../../tutorial/controlflow.rst:776
924+
#: ../../tutorial/controlflow.rst:782
924925
msgid ""
925926
"The first function definition, ``standard_arg``, the most familiar form, "
926927
"places no restrictions on the calling convention and arguments may be passed "
@@ -931,7 +932,7 @@ msgstr ""
931932
"\n"
932933
"::"
933934

934-
#: ../../tutorial/controlflow.rst:786
935+
#: ../../tutorial/controlflow.rst:792
935936
msgid ""
936937
"The second function ``pos_only_arg`` is restricted to only use positional "
937938
"parameters as there is a ``/`` in the function definition::"
@@ -940,7 +941,7 @@ msgstr ""
940941
"\n"
941942
"::"
942943

943-
#: ../../tutorial/controlflow.rst:797
944+
#: ../../tutorial/controlflow.rst:803
944945
msgid ""
945946
"The third function ``kwd_only_args`` only allows keyword arguments as "
946947
"indicated by a ``*`` in the function definition::"
@@ -949,7 +950,7 @@ msgstr ""
949950
"\n"
950951
"::"
951952

952-
#: ../../tutorial/controlflow.rst:808
953+
#: ../../tutorial/controlflow.rst:814
953954
msgid ""
954955
"And the last uses all three calling conventions in the same function "
955956
"definition::"
@@ -958,7 +959,7 @@ msgstr ""
958959
"\n"
959960
"::"
960961

961-
#: ../../tutorial/controlflow.rst:828
962+
#: ../../tutorial/controlflow.rst:834
962963
msgid ""
963964
"Finally, consider this function definition which has a potential collision "
964965
"between the positional argument ``name`` and ``**kwds`` which has ``name`` "
@@ -969,7 +970,7 @@ msgstr ""
969970
"\n"
970971
"::"
971972

972-
#: ../../tutorial/controlflow.rst:833
973+
#: ../../tutorial/controlflow.rst:839
973974
msgid ""
974975
"There is no possible call that will make it return ``True`` as the keyword "
975976
"``'name'`` will always bind to the first parameter. For example::"
@@ -979,7 +980,7 @@ msgstr ""
979980
"\n"
980981
"::"
981982

982-
#: ../../tutorial/controlflow.rst:842
983+
#: ../../tutorial/controlflow.rst:848
983984
msgid ""
984985
"But using ``/`` (positional only arguments), it is possible since it allows "
985986
"``name`` as a positional argument and ``'name'`` as a key in the keyword "
@@ -990,17 +991,17 @@ msgstr ""
990991
"\n"
991992
"::"
992993

993-
#: ../../tutorial/controlflow.rst:850
994+
#: ../../tutorial/controlflow.rst:856
994995
msgid ""
995996
"In other words, the names of positional-only parameters can be used in "
996997
"``**kwds`` without ambiguity."
997998
msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。"
998999

999-
#: ../../tutorial/controlflow.rst:855
1000+
#: ../../tutorial/controlflow.rst:861
10001001
msgid "Recap"
10011002
msgstr "回顧"
10021003

1003-
#: ../../tutorial/controlflow.rst:857
1004+
#: ../../tutorial/controlflow.rst:863
10041005
msgid ""
10051006
"The use case will determine which parameters to use in the function "
10061007
"definition::"
@@ -1009,11 +1010,11 @@ msgstr ""
10091010
"\n"
10101011
"::"
10111012

1012-
#: ../../tutorial/controlflow.rst:861
1013+
#: ../../tutorial/controlflow.rst:867
10131014
msgid "As guidance:"
10141015
msgstr "說明:"
10151016

1016-
#: ../../tutorial/controlflow.rst:863
1017+
#: ../../tutorial/controlflow.rst:869
10171018
msgid ""
10181019
"Use positional-only if you want the name of the parameters to not be "
10191020
"available to the user. This is useful when parameter names have no real "
@@ -1025,7 +1026,7 @@ msgstr ""
10251026
"想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很"
10261027
"有用。"
10271028

1028-
#: ../../tutorial/controlflow.rst:868
1029+
#: ../../tutorial/controlflow.rst:874
10291030
msgid ""
10301031
"Use keyword-only when names have meaning and the function definition is more "
10311032
"understandable by being explicit with names or you want to prevent users "
@@ -1034,19 +1035,19 @@ msgstr ""
10341035
"當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引"
10351036
"數被傳遞時的位置時,請使用僅限關鍵字。"
10361037

1037-
#: ../../tutorial/controlflow.rst:871
1038+
#: ../../tutorial/controlflow.rst:877
10381039
msgid ""
10391040
"For an API, use positional-only to prevent breaking API changes if the "
10401041
"parameter's name is modified in the future."
10411042
msgstr ""
10421043
"對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中"
10431044
"斷性變更。"
10441045

1045-
#: ../../tutorial/controlflow.rst:877
1046+
#: ../../tutorial/controlflow.rst:883
10461047
msgid "Arbitrary Argument Lists"
10471048
msgstr "任意引數列表 (Arbitrary Argument Lists)"
10481049

1049-
#: ../../tutorial/controlflow.rst:882
1050+
#: ../../tutorial/controlflow.rst:888
10501051
msgid ""
10511052
"Finally, the least frequently used option is to specify that a function can "
10521053
"be called with an arbitrary number of arguments. These arguments will be "
@@ -1059,7 +1060,7 @@ msgstr ""
10591060
"\n"
10601061
"::"
10611062

1062-
#: ../../tutorial/controlflow.rst:891
1063+
#: ../../tutorial/controlflow.rst:897
10631064
msgid ""
10641065
"Normally, these *variadic* arguments will be last in the list of formal "
10651066
"parameters, because they scoop up all remaining input arguments that are "
@@ -1073,11 +1074,11 @@ msgstr ""
10731074
"\n"
10741075
"::"
10751076

1076-
#: ../../tutorial/controlflow.rst:908
1077+
#: ../../tutorial/controlflow.rst:914
10771078
msgid "Unpacking Argument Lists"
10781079
msgstr "拆解引數列表(Unpacking Argument Lists)"
10791080

1080-
#: ../../tutorial/controlflow.rst:910
1081+
#: ../../tutorial/controlflow.rst:916
10811082
msgid ""
10821083
"The reverse situation occurs when the arguments are already in a list or "
10831084
"tuple but need to be unpacked for a function call requiring separate "
@@ -1093,7 +1094,7 @@ msgstr ""
10931094
"\n"
10941095
"::"
10951096

1096-
#: ../../tutorial/controlflow.rst:926
1097+
#: ../../tutorial/controlflow.rst:932
10971098
msgid ""
10981099
"In the same fashion, dictionaries can deliver keyword arguments with the "
10991100
"``**``\\ -operator::"
@@ -1102,11 +1103,11 @@ msgstr ""
11021103
"\n"
11031104
"::"
11041105

1105-
#: ../../tutorial/controlflow.rst:942
1106+
#: ../../tutorial/controlflow.rst:948
11061107
msgid "Lambda Expressions"
11071108
msgstr "Lambda 運算式"
11081109

1109-
#: ../../tutorial/controlflow.rst:944
1110+
#: ../../tutorial/controlflow.rst:950
11101111
msgid ""
11111112
"Small anonymous functions can be created with the :keyword:`lambda` keyword. "
11121113
"This function returns the sum of its two arguments: ``lambda a, b: a+b``. "
@@ -1123,7 +1124,7 @@ msgstr ""
11231124
"\n"
11241125
"::"
11251126

1126-
#: ../../tutorial/controlflow.rst:961
1127+
#: ../../tutorial/controlflow.rst:967
11271128
msgid ""
11281129
"The above example uses a lambda expression to return a function. Another "
11291130
"use is to pass a small function as an argument::"
@@ -1133,17 +1134,17 @@ msgstr ""
11331134
"\n"
11341135
"::"
11351136

1136-
#: ../../tutorial/controlflow.rst:973
1137+
#: ../../tutorial/controlflow.rst:979
11371138
msgid "Documentation Strings"
11381139
msgstr "說明文件字串 (Documentation Strings)"
11391140

1140-
#: ../../tutorial/controlflow.rst:980
1141+
#: ../../tutorial/controlflow.rst:986
11411142
msgid ""
11421143
"Here are some conventions about the content and formatting of documentation "
11431144
"strings."
11441145
msgstr "以下是關於說明文件字串內容和格式的慣例。"
11451146

1146-
#: ../../tutorial/controlflow.rst:983
1147+
#: ../../tutorial/controlflow.rst:989
11471148
msgid ""
11481149
"The first line should always be a short, concise summary of the object's "
11491150
"purpose. For brevity, it should not explicitly state the object's name or "
@@ -1155,7 +1156,7 @@ msgstr ""
11551156
"的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運"
11561157
"算的動詞)。這一行應以大寫字母開頭,以句號結尾。"
11571158

1158-
#: ../../tutorial/controlflow.rst:989
1159+
#: ../../tutorial/controlflow.rst:995
11591160
msgid ""
11601161
"If there are more lines in the documentation string, the second line should "
11611162
"be blank, visually separating the summary from the rest of the description. "
@@ -1165,7 +1166,7 @@ msgstr ""
11651166
"文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可"
11661167
"包含一或多個段落,描述此物件的呼叫慣例、副作用等。"
11671168

1168-
#: ../../tutorial/controlflow.rst:994
1169+
#: ../../tutorial/controlflow.rst:1000
11691170
msgid ""
11701171
"The Python parser does not strip indentation from multi-line string literals "
11711172
"in Python, so tools that process documentation have to strip indentation if "
@@ -1187,18 +1188,18 @@ msgstr ""
11871188
"出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格),"
11881189
"應測試空白字元量是否等價。"
11891190

1190-
#: ../../tutorial/controlflow.rst:1006
1191+
#: ../../tutorial/controlflow.rst:1012
11911192
msgid "Here is an example of a multi-line docstring::"
11921193
msgstr ""
11931194
"下面是多行說明字串的一個範例:\n"
11941195
"\n"
11951196
"::"
11961197

1197-
#: ../../tutorial/controlflow.rst:1024
1198+
#: ../../tutorial/controlflow.rst:1030
11981199
msgid "Function Annotations"
11991200
msgstr "函式註釋 (Function Annotations)"
12001201

1201-
#: ../../tutorial/controlflow.rst:1032
1202+
#: ../../tutorial/controlflow.rst:1038
12021203
msgid ""
12031204
":ref:`Function annotations <function>` are completely optional metadata "
12041205
"information about the types used by user-defined functions (see :pep:`3107` "
@@ -1207,7 +1208,7 @@ msgstr ""
12071208
":ref:`函式註釋 <function>`\\ 是選擇性的元資料(metadata)資訊,描述使用者定義"
12081209
"函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。"
12091210

1210-
#: ../../tutorial/controlflow.rst:1036
1211+
#: ../../tutorial/controlflow.rst:1042
12111212
msgid ""
12121213
":term:`Annotations <function annotation>` are stored in the :attr:"
12131214
"`__annotations__` attribute of the function as a dictionary and have no "
@@ -1227,11 +1228,11 @@ msgstr ""
12271228
"\n"
12281229
"::"
12291230

1230-
#: ../../tutorial/controlflow.rst:1058
1231+
#: ../../tutorial/controlflow.rst:1064
12311232
msgid "Intermezzo: Coding Style"
12321233
msgstr "間奏曲:程式碼風格 (Coding Style)"
12331234

1234-
#: ../../tutorial/controlflow.rst:1063
1235+
#: ../../tutorial/controlflow.rst:1069
12351236
msgid ""
12361237
"Now that you are about to write longer, more complex pieces of Python, it is "
12371238
"a good time to talk about *coding style*. Most languages can be written (or "
@@ -1244,7 +1245,7 @@ msgstr ""
12441245
"式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優"
12451246
"良的編碼樣式對此有極大的幫助。"
12461247

1247-
#: ../../tutorial/controlflow.rst:1069
1248+
#: ../../tutorial/controlflow.rst:1075
12481249
msgid ""
12491250
"For Python, :pep:`8` has emerged as the style guide that most projects "
12501251
"adhere to; it promotes a very readable and eye-pleasing coding style. Every "
@@ -1254,11 +1255,11 @@ msgstr ""
12541255
"對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀"
12551256
"且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:"
12561257

1257-
#: ../../tutorial/controlflow.rst:1074
1258+
#: ../../tutorial/controlflow.rst:1080
12581259
msgid "Use 4-space indentation, and no tabs."
12591260
msgstr "用 4 個空格縮排,不要用 tab 鍵。"
12601261

1261-
#: ../../tutorial/controlflow.rst:1076
1262+
#: ../../tutorial/controlflow.rst:1082
12621263
msgid ""
12631264
"4 spaces are a good compromise between small indentation (allows greater "
12641265
"nesting depth) and large indentation (easier to read). Tabs introduce "
@@ -1267,41 +1268,41 @@ msgstr ""
12671268
"4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。"
12681269
"Tab 鍵會造成混亂,最好別用。"
12691270

1270-
#: ../../tutorial/controlflow.rst:1080
1271+
#: ../../tutorial/controlflow.rst:1086
12711272
msgid "Wrap lines so that they don't exceed 79 characters."
12721273
msgstr "換行,使一行不超過 79 個字元。"
12731274

1274-
#: ../../tutorial/controlflow.rst:1082
1275+
#: ../../tutorial/controlflow.rst:1088
12751276
msgid ""
12761277
"This helps users with small displays and makes it possible to have several "
12771278
"code files side-by-side on larger displays."
12781279
msgstr ""
12791280
"換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼"
12801281
"檔案。"
12811282

1282-
#: ../../tutorial/controlflow.rst:1085
1283+
#: ../../tutorial/controlflow.rst:1091
12831284
msgid ""
12841285
"Use blank lines to separate functions and classes, and larger blocks of code "
12851286
"inside functions."
12861287
msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。"
12871288

1288-
#: ../../tutorial/controlflow.rst:1088
1289+
#: ../../tutorial/controlflow.rst:1094
12891290
msgid "When possible, put comments on a line of their own."
12901291
msgstr "如果可以,把註解放在單獨一行。"
12911292

1292-
#: ../../tutorial/controlflow.rst:1090
1293+
#: ../../tutorial/controlflow.rst:1096
12931294
msgid "Use docstrings."
12941295
msgstr "使用說明字串。"
12951296

1296-
#: ../../tutorial/controlflow.rst:1092
1297+
#: ../../tutorial/controlflow.rst:1098
12971298
msgid ""
12981299
"Use spaces around operators and after commas, but not directly inside "
12991300
"bracketing constructs: ``a = f(1, 2) + g(3, 4)``."
13001301
msgstr ""
13011302
"運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, "
13021303
"4)``\\ 。"
13031304

1304-
#: ../../tutorial/controlflow.rst:1095
1305+
#: ../../tutorial/controlflow.rst:1101
13051306
msgid ""
13061307
"Name your classes and functions consistently; the convention is to use "
13071308
"``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for "
@@ -1313,7 +1314,7 @@ msgstr ""
13131314
"底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method,"
13141315
"詳見 :ref:`tut-firstclasses`\\ )。"
13151316

1316-
#: ../../tutorial/controlflow.rst:1100
1317+
#: ../../tutorial/controlflow.rst:1106
13171318
msgid ""
13181319
"Don't use fancy encodings if your code is meant to be used in international "
13191320
"environments. Python's default, UTF-8, or even plain ASCII work best in any "
@@ -1322,7 +1323,7 @@ msgstr ""
13221323
"若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普"
13231324
"通的 ASCII,就可以勝任各種情況。"
13241325

1325-
#: ../../tutorial/controlflow.rst:1104
1326+
#: ../../tutorial/controlflow.rst:1110
13261327
msgid ""
13271328
"Likewise, don't use non-ASCII characters in identifiers if there is only the "
13281329
"slightest chance people speaking a different language will read or maintain "
@@ -1331,11 +1332,11 @@ msgstr ""
13311332
"同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用"
13321333
"非 ASCII 字元。"
13331334

1334-
#: ../../tutorial/controlflow.rst:1110
1335+
#: ../../tutorial/controlflow.rst:1116
13351336
msgid "Footnotes"
13361337
msgstr "註解"
13371338

1338-
#: ../../tutorial/controlflow.rst:1111
1339+
#: ../../tutorial/controlflow.rst:1117
13391340
msgid ""
13401341
"Actually, *call by object reference* would be a better description, since if "
13411342
"a mutable object is passed, the caller will see any changes the callee makes "
@@ -1353,54 +1354,54 @@ msgstr "statement(陳述式)"
13531354
msgid "for"
13541355
msgstr "for"
13551356

1356-
#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975
1357+
#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981
13571358
msgid "documentation strings"
13581359
msgstr "ddocumentation strings(說明字串)"
13591360

1360-
#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975
1361+
#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981
13611362
msgid "docstrings"
13621363
msgstr "docstrings(說明字串)"
13631364

1364-
#: ../../tutorial/controlflow.rst:438 ../../tutorial/controlflow.rst:975
1365+
#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981
13651366
msgid "strings, documentation"
13661367
msgstr "strings(字串), documentation(說明文件)"
13671368

1368-
#: ../../tutorial/controlflow.rst:879
1369+
#: ../../tutorial/controlflow.rst:885
13691370
msgid "* (asterisk)"
13701371
msgstr "* (星號)"
13711372

1372-
#: ../../tutorial/controlflow.rst:879 ../../tutorial/controlflow.rst:923
1373+
#: ../../tutorial/controlflow.rst:885 ../../tutorial/controlflow.rst:929
13731374
msgid "in function calls"
13741375
msgstr "於函式呼叫中"
13751376

1376-
#: ../../tutorial/controlflow.rst:923
1377+
#: ../../tutorial/controlflow.rst:929
13771378
msgid "**"
13781379
msgstr "**"
13791380

1380-
#: ../../tutorial/controlflow.rst:1027
1381+
#: ../../tutorial/controlflow.rst:1033
13811382
msgid "function"
13821383
msgstr "function(函式)"
13831384

1384-
#: ../../tutorial/controlflow.rst:1027
1385+
#: ../../tutorial/controlflow.rst:1033
13851386
msgid "annotations"
13861387
msgstr "annotations(註釋)"
13871388

1388-
#: ../../tutorial/controlflow.rst:1027
1389+
#: ../../tutorial/controlflow.rst:1033
13891390
msgid "->"
13901391
msgstr "->"
13911392

1392-
#: ../../tutorial/controlflow.rst:1027
1393+
#: ../../tutorial/controlflow.rst:1033
13931394
msgid "function annotations"
13941395
msgstr "function annotations(函式註釋)"
13951396

1396-
#: ../../tutorial/controlflow.rst:1027
1397+
#: ../../tutorial/controlflow.rst:1033
13971398
msgid ": (colon)"
13981399
msgstr ": (冒號)"
13991400

1400-
#: ../../tutorial/controlflow.rst:1061
1401+
#: ../../tutorial/controlflow.rst:1067
14011402
msgid "coding"
14021403
msgstr "coding(程式編寫)"
14031404

1404-
#: ../../tutorial/controlflow.rst:1061
1405+
#: ../../tutorial/controlflow.rst:1067
14051406
msgid "style"
14061407
msgstr "style(風格)"

0 commit comments

Comments
 (0)
Please sign in to comment.