@@ -8,7 +8,7 @@ msgstr ""
8
8
"Project-Id-Version : Python 3.6 TW\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"POT-Creation-Date : 2018-06-26 18:54+0800\n "
11
- "PO-Revision-Date : 2018-10-19 01:44 +0800\n "
11
+ "PO-Revision-Date : 2018-10-19 10:05 +0800\n "
12
12
"Last-Translator : Adrian Liaw <adrianliaw2000@gmail.com>\n "
13
13
"Language-Team : Chinese Traditional (http://www.transifex.com/python-tw-doc/ "
14
14
"python-36-tw/language/zh-Hant/)\n "
@@ -666,7 +666,7 @@ msgstr "正確的類別設計應該使用實例變數::"
666
666
667
667
#: ../../tutorial/classes.rst:474
668
668
msgid "Random Remarks"
669
- msgstr ""
669
+ msgstr "隨意的備註 "
670
670
671
671
#: ../../tutorial/classes.rst:478
672
672
msgid ""
@@ -678,6 +678,10 @@ msgid ""
678
678
"just an underscore), or using verbs for methods and nouns for data "
679
679
"attributes."
680
680
msgstr ""
681
+ "資料屬性以相同的名稱覆寫方法屬性;為了避免意外的名稱衝突,該衝突將會導致在大"
682
+ "的程式中難以發現的錯,明智的方法是使用某種最小化發生衝突的機會之慣例。可能的"
683
+ "慣例包含大寫方法名稱,使用小的唯一字串(可能只是下底線)替資料屬性名稱添加前"
684
+ "綴,或使用動詞作為方法名稱名詞作為資料屬性名稱。"
681
685
682
686
#: ../../tutorial/classes.rst:485
683
687
msgid ""
@@ -689,6 +693,10 @@ msgid ""
689
693
"implementation details and control access to an object if necessary; this "
690
694
"can be used by extensions to Python written in C.)"
691
695
msgstr ""
696
+ "資料屬性可能被方法及物件的普通用戶(客戶端)所參照。也就是說,類別不可用於實"
697
+ "作純粹的抽象資料型態。事實上,在 Python 中沒有任何東西可以有可能使資料隱藏 "
698
+ "--- 這全是基於慣例。(另一方面,以 C 實作的 Python 可以完全隱藏實作細節並且必"
699
+ "要的話控制物件的存取;這樣可以被以 C 寫的 Python 擴充所使用)"
692
700
693
701
#: ../../tutorial/classes.rst:493
694
702
msgid ""
@@ -698,6 +706,9 @@ msgid ""
698
706
"without affecting the validity of the methods, as long as name conflicts are "
699
707
"avoided --- again, a naming convention can save a lot of headaches here."
700
708
msgstr ""
709
+ "客戶端應該小心使用資料屬性 --- 客戶端可能會通過標記其資料屬性來破壞方法維持的"
710
+ "不變性。注意客戶端可能增加資料屬性到實例物件,而不會影響方法的有效性,只要避"
711
+ "免名稱衝突即可 --- 再一次提醒,命名慣例可以在這裡節省很多麻煩。"
701
712
702
713
#: ../../tutorial/classes.rst:499
703
714
msgid ""
@@ -706,6 +717,8 @@ msgid ""
706
717
"methods: there is no chance of confusing local variables and instance "
707
718
"variables when glancing through a method."
708
719
msgstr ""
720
+ "在方法中參照資料屬性(或其他方法!)是沒有簡寫的。我發現這實際上增加了方法的"
721
+ "可閱讀性:在看方法時,沒有機會混淆區域變數和實例變數。"
709
722
710
723
#: ../../tutorial/classes.rst:504
711
724
msgid ""
@@ -716,14 +729,18 @@ msgid ""
716
729
"that a *class browser* program might be written that relies upon such a "
717
730
"convention."
718
731
msgstr ""
732
+ "通常,方法的第一個參數被叫做 ``self``。這僅僅只是一個慣例:``self`` 這個名字"
733
+ "對 Python 來說完全沒有特別的意味。但請注意,如果不遵循慣例,你的程式碼可能對"
734
+ "其他 Python 程式員來說可讀性較低,並且也可以想像一個可能依賴於此慣例編寫的 "
735
+ "*class browser* 程式。"
719
736
720
737
#: ../../tutorial/classes.rst:510
721
738
msgid ""
722
739
"Any function object that is a class attribute defines a method for instances "
723
740
"of that class. It is not necessary that the function definition is "
724
741
"textually enclosed in the class definition: assigning a function object to a "
725
742
"local variable in the class is also ok. For example::"
726
- msgstr ""
743
+ msgstr "任何是類別屬性的函式物件定義了一個該類別實例的方法。 "
727
744
728
745
#: ../../tutorial/classes.rst:527
729
746
msgid ""
@@ -732,12 +749,15 @@ msgid ""
732
749
"class:`C` --- ``h`` being exactly equivalent to ``g``. Note that this "
733
750
"practice usually only serves to confuse the reader of a program."
734
751
msgstr ""
752
+ "現在 ``f``、 ``g`` 和 ``h`` 都是類別 :class:`C` 的屬性,並涉及函數物件,所以"
753
+ "他們都是類別 :class:`C` 的實例的方法 --- ``h`` 與 ``g`` 是完全一樣的。請注"
754
+ "意,這種做法通常只會使該程式的讀者感到困惑。"
735
755
736
756
#: ../../tutorial/classes.rst:532
737
757
msgid ""
738
758
"Methods may call other methods by using method attributes of the ``self`` "
739
759
"argument::"
740
- msgstr ""
760
+ msgstr "方法可以藉由使用 ``self`` 參數的方法屬性呼叫其他方法:: "
741
761
742
762
#: ../../tutorial/classes.rst:546
743
763
msgid ""
@@ -751,12 +771,20 @@ msgid ""
751
771
"itself defined in this global scope, and in the next section we'll find some "
752
772
"good reasons why a method would want to reference its own class."
753
773
msgstr ""
774
+ "方法可以用與一般函數相同的方式參照全域名稱。與方法相關的全域作用域是包含其定"
775
+ "義的模組。(類別永遠不會被用作全局範圍。)雖然人們很少有一個在方法中使用全域"
776
+ "資料的充分理由,但全域作用域有許多合法使用:一方面,導入全域作用域的函數和模"
777
+ "組可以由方法以及在其中定義的函數和類別所使用。通常,包含該方法的類別本身被定"
778
+ "義在全域作用域,\n"
779
+ "在下一節,我們將找到想要參照自身類別的方法的一些好理由。"
754
780
755
781
#: ../../tutorial/classes.rst:556
756
782
msgid ""
757
783
"Each value is an object, and therefore has a *class* (also called its "
758
784
"*type*). It is stored as ``object.__class__``."
759
785
msgstr ""
786
+ "每個值都是一個物件,因此有一個 *class*(也可以稱作 *type*)。他被存在 "
787
+ "``object.__class__``。"
760
788
761
789
#: ../../tutorial/classes.rst:563
762
790
msgid "Inheritance"
0 commit comments