8000 Translate faq/design.html#why-is-join-a-string-method-instead-of-a-li… · python/python-docs-zh-tw@be90f1f · GitHub
[go: up one dir, main page]

Skip to content

Commit be90f1f

Browse files
committed
Translate faq/design.html#why-is-join-a-string-method-instead-of-a-list-or-tuple-method
1 parent 0cc8df4 commit be90f1f

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

faq/design.po

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ msgstr ""
347347

348348
#: ../../faq/design.rst:193
349349
msgid "Why is join() a string method instead of a list or tuple method?"
350-
msgstr ""
350+
msgstr "為何 join() 是字串方法而非串列 (list) 或值組 (tuple) 方法?"
351351

352352
#: ../../faq/design.rst:195
353353
msgid ""
@@ -357,14 +357,22 @@ msgid ""
357357
"methods have been widely accepted, but the one which appears to make some "
358358
"programmers feel uncomfortable is::"
359359
msgstr ""
360+
"自 Python 1.6 之後,字串變得很像其他標準的型別,也在此時,一些可以和字串模組"
361+
"的函式有相同功能的方法也被加入。大多數的新方法都被廣泛接受,但有一個方法似乎"
362+
"讓一些程式人員不舒服:\n"
363+
"\n"
364+
"::"
360365

361366
#: ../../faq/design.rst:203
362367
msgid "which gives the result::"
363368
msgstr ""
369+
"結果是:\n"
370+
"\n"
371+
"::"
364372

365373
#: ../../faq/design.rst:207
366374
msgid "There are two common arguments against this usage."
367-
msgstr ""
375+
msgstr "通常有兩個反對這個用法的論點。"
368376

369377
#: ../../faq/design.rst:209
370378
msgid ""
@@ -374,6 +382,9 @@ msgid ""
374382
"on names bound to strings there is no logical reason to make them "
375383
"unavailable on literals."
376384
msgstr ""
385+
"第一項這麼說:「用字串文本(字串常數)看起來真的很醜」,也許真的如此,但字串"
386+
"文本就只是一個固定值。如果方法可以用在值為字串的變數上,那沒道理字串文本不能"
387+
"被使用。"
377388

378389
#: ../../faq/design.rst:215
379390
msgid ""
@@ -382,12 +393,19 @@ msgid ""
382393
"For some reason there seems to be much less difficulty with having :meth:"
383394
"`~str.split` as a string method, since in that case it is easy to see that ::"
384395
msgstr ""
396+
"第二個反對意見通常是:「我是在叫一個序列把它的成員用一個字串常數連接起來」。"
397+
"但很遺憾地,你並不是在這樣做。因為某種原因,把 :meth:`~str.split` 當成字串方"
398+
"法比較簡單,因為這樣我們可以輕易地看到:\n"
399+
"\n"
400+
"::"
385401

386402
#: ../../faq/design.rst:222
387403
msgid ""
388404
"is an instruction to a string literal to return the substrings delimited by "
389405
"the given separator (or, by default, arbitrary runs of white space)."
390406
msgstr ""
407+
"這是在叫一個字串文本回傳由指定的分隔符號(或是預設為空白)分出的子字串的指"
408+
"令。"
391409

392410
#: ../../faq/design.rst:225
393411
msgid ""
@@ -397,6 +415,9 @@ msgid ""
397415
"obeys the rules for sequence objects, including any new classes you might "
398416
"define yourself. Similar methods exist for bytes and bytearray objects."
399417
msgstr ""
418+
":meth:`~str.join` 是一個字串方法,因為再用他的時候,你是告訴分隔字串去走遍整"
419+
"個字串序列,並將自己插入到相鄰的兩項之間。這個方法的參數可以是任何符合序列規"
420+
"則的物件,包括自定義的新類別。在 bytes 和 bytearray 物件也有類似的方法可用。"
400421

401422
#: ../../faq/design.rst:233
402423
msgid "How fast are exceptions?"

0 commit comments

Comments
 (0)
0