Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1e195a

Browse files
committed
fix: resolve code block translation - part 5
1 parent1c8a2aa commitf1e195a

File tree

121 files changed

+36026
-1333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+36026
-1333
lines changed

‎c-api/exceptions.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ msgstr ""
139139

140140
#:../../c-api/exceptions.rst:98
141141
msgid"Use :func:`sys.unraisablehook`."
142-
msgstr""
142+
msgstr"使用 :func:`sys.unraisablehook`。"
143143

144144
#:../../c-api/exceptions.rst:104
145145
msgid""

‎c-api/init_config.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,7 @@ msgstr ""
22712271

22722272
#:../../c-api/init_config.rst:1581
22732273
msgid"Import the :mod:`site` module;"
2274-
msgstr""
2274+
msgstr"引入 :mod:`site` 模組;"
22752275

22762276
#:../../c-api/init_config.rst:1582
22772277
msgid"etc."

‎c-api/memory.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ msgstr ""
266266

267267
#:../../c-api/memory.rst:197
268268
msgid"Memory Interface"
269-
msgstr""
269+
msgstr"記憶體介面"
270270

271271
#:../../c-api/memory.rst:199../../c-api/memory.rst:305
272272
msgid""

‎faq/programming.po

Lines changed: 103 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,7 @@ msgstr ""
25522552
#:../../faq/programming.rst:1273
25532553
#,fuzzy
25542554
msgid"How do I create a multidimensional list?"
2555-
msgstr"如何建立多維list?"
2555+
msgstr"如何建立多維 list?"
25562556

25572557
#:../../faq/programming.rst:1275
25582558
#,fuzzy
@@ -2561,10 +2561,9 @@ msgstr "你可能嘗試製作這樣的多維數組: ::"
25612561

25622562
#:../../faq/programming.rst:1277
25632563
msgid">>> A = [[None] * 2] * 3"
2564-
msgstr""
2564+
msgstr">>> A = [[None] * 2] * 3"
25652565

25662566
#:../../faq/programming.rst:1279
2567-
#,fuzzy
25682567
msgid"This looks correct if you print it:"
25692568
msgstr"如果你印出它,這看起來是正確的:"
25702569

@@ -2573,6 +2572,8 @@ msgid ""
25732572
">>> A\n"
25742573
"[[None, None], [None, None], [None, None]]"
25752574
msgstr""
2575+
">>> A\n"
2576+
"[[None, None], [None, None], [None, None]]"
25762577

25772578
#:../../faq/programming.rst:1290
25782579
#,fuzzy
@@ -2774,6 +2775,8 @@ msgid ""
27742775
">>> a_tuple[0]\n"
27752776
"['foo', 'item']"
27762777
msgstr""
2778+
">>> a_tuple[0]\n"
2779+
"['foo', 'item']"
27772780

27782781
#:../../faq/programming.rst:1396
27792782
#,fuzzy
@@ -2798,6 +2801,10 @@ msgid ""
27982801
">>> a_list\n"
27992802
"[1]"
28002803
msgstr""
2804+
">>> a_list = []\n"
2805+
">>> a_list += [1]\n"
2806+
">>> a_list\n"
2807+
"[1]"
28012808

28022809
#:../../faq/programming.rst:1409
28032810
msgid"This is equivalent to::"
@@ -2808,6 +2815,8 @@ msgid ""
28082815
">>> result = a_list.__iadd__([1])\n"
28092816
">>> a_list = result"
28102817
msgstr""
2818+
">>> result = a_list.__iadd__([1])\n"
2819+
">>> a_list = result"
28112820

28122821
#:../../faq/programming.rst:1414
28132822
#,fuzzy
@@ -2871,6 +2880,8 @@ msgid ""
28712880
"Isorted = L[:]\n"
28722881
"Isorted.sort(key=lambda s: int(s[10:15]))"
28732882
msgstr""
2883+
"Isorted = L[:]\n"
2884+
"Isorted.sort(key=lambda s: int(s[10:15]))"
28742885

28752886
#:../../faq/programming.rst:1444
28762887
#,fuzzy
@@ -2899,6 +2910,16 @@ msgid ""
28992910
">>> result\n"
29002911
"['else', 'sort', 'to', 'something']"
29012912
msgstr""
2913+
">>> list1 = [\"what\",\"I'm\",\"sorting\",\"by\"]\n"
2914+
">>> list2 = [\"something\",\"else\",\"to\",\"sort\"]\n"
2915+
">>> pairs = zip(list1, list2)\n"
2916+
">>> pairs = sorted(pairs)\n"
2917+
">>> pairs\n"
2918+
"[(\"I'm\", 'else'), ('by', 'sort'), ('sorting', 'to'), ('what', "
2919+
"'something')]\n"
2920+
">>> result = [x[1] for x in pairs]\n"
2921+
">>> result\n"
2922+
"['else', 'sort', 'to', 'something']"
29022923

29032924
#:../../faq/programming.rst:1461
29042925
msgid"Objects"
@@ -2954,6 +2975,9 @@ msgid ""
29542975
" def meth(self, arg):\n"
29552976
" return arg * 2 + self.attribute"
29562977
msgstr""
2978+
"class C:\n"
2979+
" def meth(self, arg):\n"
2980+
" return arg * 2 + self.attribute"
29572981

29582982
#:../../faq/programming.rst:1491
29592983
#,fuzzy
@@ -3023,6 +3047,15 @@ msgid ""
30233047
"\n"
30243048
"Mapping.register(P)"
30253049
msgstr""
3050+
"from collections.abc import Mapping\n"
3051+
"\n"
3052+
"class P:\n"
3053+
" pass\n"
3054+
"\n"
3055+
"class C(P):\n"
3056+
" pass\n"
3057+
"\n"
3058+
"Mapping.register(P)"
30263059

30273060
#:../../faq/programming.rst:1528
30283061
msgid""
@@ -3066,6 +3099,12 @@ msgid ""
30663099
" ... # code to search a document\n"
30673100
" elif ..."
30683101
msgstr""
3102+
"def search(obj):\n"
3103+
" if isinstance(obj, Mailbox):\n"
3104+
" ... # code to search a mailbox\n"
3105+
" elif isinstance(obj, Document):\n"
3106+
" ... # code to search a document\n"
3107+
" elif ..."
30693108

30703109
#:../../faq/programming.rst:1560
30713110
#,fuzzy
@@ -3128,6 +3167,16 @@ msgid ""
31283167
" def __getattr__(self, name):\n"
31293168
" return getattr(self._outfile, name)"
31303169
msgstr""
3170+
"class UpperOut:\n"
3171+
"\n"
3172+
" def __init__(self, outfile):\n"
3173+
" self._outfile = outfile\n"
3174+
"\n"
3175+
" def write(self, s):\n"
3176+
" self._outfile.write(s.upper())\n"
3177+
"\n"
3178+
" def __getattr__(self, name):\n"
3179+
" return getattr(self._outfile, name)"
31313180

31323181
#:../../faq/programming.rst:1598
31333182
#,fuzzy
@@ -3165,6 +3214,11 @@ msgid ""
31653214
" self.__dict__[name] = value\n"
31663215
" ..."
31673216
msgstr""
3217+
"class X:\n"
3218+
" ...\n"
3219+
" def __setattr__(self, name, value):\n"
3220+
" self.__dict__[name] = value\n"
3221+
" ..."
31683222

31693223
#:../../faq/programming.rst:1616
31703224
#,fuzzy
@@ -3184,7 +3238,6 @@ msgid ""
31843238
msgstr"如何從擴充它的衍生類別呼叫基底類別中定義的方法?"
31853239

31863240
#:../../faq/programming.rst:1624
3187-
#,fuzzy
31883241
msgid"Use the built-in :func:`super` function::"
31893242
msgstr"使用內建的 :func:`super` 函式: ::"
31903243

@@ -3194,6 +3247,9 @@ msgid ""
31943247
" def meth(self):\n"
31953248
" super().meth() # calls Base.meth"
31963249
msgstr""
3250+
"class Derived(Base):\n"
3251+
" def meth(self):\n"
3252+
" super().meth() # calls Base.meth"
31973253

31983254
#:../../faq/programming.rst:1630
31993255
#,fuzzy
@@ -3233,6 +3289,13 @@ msgid ""
32333289
"class Derived(BaseAlias):\n"
32343290
" ..."
32353291
msgstr""
3292+
"class Base:\n"
3293+
" ...\n"
3294+
"\n"
3295+
"BaseAlias = Base\n"
3296+
"\n"
3297+
"class Derived(BaseAlias):\n"
3298+
" ..."
32363299

32373300
#:../../faq/programming.rst:1654
32383301
#,fuzzy
@@ -3274,9 +3337,9 @@ msgid ""
32743337
"``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some "
32753338
"class on the base-class search path from ``c.__class__`` back to ``C``."
32763339
msgstr""
3277-
"``c.count`` 還指代任何``c`` 的``C.count`` 使得``isinstance(c, C)`` 成立,除非"
3278-
"``c`` 本身或某些人覆蓋從``c.__class__`` 回到``C``的基底類別搜索路徑上的類"
3279-
"。"
3340+
"``c.count`` 還指代任何``c`` 的``C.count`` 使得``isinstance(c, C)`` 成立,"
3341+
"除非被``c`` 本身或某些人覆蓋從``c.__class__`` 回到``C``的基底類別搜索路徑"
3342+
"上的類別。"
32803343

32813344
#:../../faq/programming.rst:1675
32823345
#,fuzzy
@@ -3292,10 +3355,9 @@ msgstr ""
32923355

32933356
#:../../faq/programming.rst:1680
32943357
msgid"C.count = 314"
3295-
msgstr""
3358+
msgstr"C.count = 314"
32963359

32973360
#:../../faq/programming.rst:1682
3298-
#,fuzzy
32993361
msgid"Static methods are possible::"
33003362
msgstr"靜態方法是可能的: ::"
33013363

@@ -3307,6 +3369,11 @@ msgid ""
33073369
" # No 'self' parameter!\n"
33083370
" ..."
33093371
msgstr""
3372+
"class C:\n"
3373+
" @staticmethod\n"
3374+
" def static(arg1, arg2, arg3):\n"
3375+
" # 沒有 'self' 參數!\n"
3376+
" ..."
33103377

33113378
#:../../faq/programming.rst:1690
33123379
#,fuzzy
@@ -3321,6 +3388,8 @@ msgid ""
33213388
"def getcount():\n"
33223389
" return C.count"
33233390
msgstr""
3391+
"def getcount():\n"
3392+
" return C.count"
33243393

33253394
#:../../faq/programming.rst:1696
33263395
#,fuzzy
@@ -3345,9 +3414,8 @@ msgstr ""
33453414
"這個答案實際上適用於所有方法,但這個問題通常首先出現在構造函式的上下文中。"
33463415

33473416
#:../../faq/programming.rst:1706
3348-
#,fuzzy
33493417
msgid"In C++ you'd write"
3350-
msgstr"在 C++中你會寫"
3418+
msgstr"在 C++中你會寫成"
33513419

33523420
#:../../faq/programming.rst:1708
33533421
msgid""
@@ -3356,6 +3424,10 @@ msgid ""
33563424
" C(int i) { cout <<\"Argument is\" << i <<\"\\n\"; }\n"
33573425
"}"
33583426
msgstr""
3427+
"class C {\n"
3428+
" C() { cout <<\"No arguments\\n\"; }\n"
3429+
" C(int i) { cout <<\"Argument is\" << i <<\"\\n\"; }\n"
3430+
"}"
33593431

33603432
#:../../faq/programming.rst:1715
33613433
#,fuzzy
@@ -3374,6 +3446,12 @@ msgid ""
33743446
" else:\n"
33753447
" print(\"Argument is\", i)"
33763448
msgstr""
3449+
"class C:\n"
3450+
" def __init__(self, i=None):\n"
3451+
" if i is None:\n"
3452+
" print(\"No arguments\")\n"
3453+
" else:\n"
3454+
" print(\"Argument is\", i)"
33773455

33783456
#:../../faq/programming.rst:1725
33793457
#,fuzzy
@@ -3383,13 +3461,15 @@ msgstr "這並不完全等價,但在實踐中足夠接近。"
33833461
#:../../faq/programming.rst:1727
33843462
#,fuzzy
33853463
msgid"You could also try a variable-length argument list, e.g. ::"
3386-
msgstr"你也可以嘗試可變長度引數list,例如: ::"
3464+
msgstr"你也可以嘗試可變長度引數 list,例如: ::"
33873465

33883466
#:../../faq/programming.rst:1729
33893467
msgid""
33903468
"def __init__(self, *args):\n"
33913469
" ..."
33923470
msgstr""
3471+
"def __init__(self, *args):\n"
3472+
" ..."
33933473

33943474
#:../../faq/programming.rst:1732
33953475
#,fuzzy
@@ -3436,6 +3516,17 @@ msgid ""
34363516
"\n"
34373517
"four = 4 * A()._A__one()"
34383518
msgstr""
3519+
"class A:\n"
3520+
" def __one(self):\n"
3521+
" return 1\n"
3522+
" def two(self):\n"
3523+
" return 2 * self.__one()\n"
3524+
"\n"
3525+
"class B(A):\n"
3526+
" def three(self):\n"
3527+
" return 3 * self._A__one()\n"
3528+
"\n"
3529+
"four = 4 * A()._A__one()"
34393530

34403531
#:../../faq/programming.rst:1761
34413532
#,fuzzy

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp