Skip to content

Commit 30d4fb4

Browse files
Copilotmattwang44
andauthored
Fix fuzzy entries in tutorial and whatsnew files
- tutorial/datastructures.po: Update *x* -> *value* in 3 method descriptions - tutorial/errors.po: Update except clause wording, code block, and ExceptionGroup example - tutorial/stdlib.po: Fix section header capitalizations (13 entries) and datetime code block - whatsnew/2.3.po: Update datetime code to use 'import datetime as dt' style - whatsnew/2.5.po: Update datetime code to use 'import datetime as dt' style - whatsnew/3.2.po: Update datetime code to use 'import datetime as dt' style - whatsnew/3.8.po: Update date.today() call to use dt.date.today() - whatsnew/3.9.po: Update zoneinfo example to use 'import datetime as dt' and rename variable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mattwang44 <24987826+mattwang44@users.noreply.github.com>
1 parent 9e8840f commit 30d4fb4

File tree

8 files changed

+27
-51
lines changed

8 files changed

+27
-51
lines changed

tutorial/datastructures.po

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ msgstr ""
7171
"``a.append(x)``。"
7272

7373
#: ../../tutorial/datastructures.rst:42
74-
#, fuzzy
7574
msgid ""
7675
"Remove the first item from the list whose value is equal to *value*. It "
7776
"raises a :exc:`ValueError` if there is no such item."
7877
msgstr ""
79-
"刪除 list 中第一個值等於 *x* 的元素。若 list 中無此元素則會觸發 :exc:"
78+
"刪除 list 中第一個值等於 *value* 的元素。若 list 中無此元素則會觸發 :exc:"
8079
"`ValueError`。"
8180

8281
#: ../../tutorial/datastructures.rst:49
@@ -95,13 +94,12 @@ msgid "Remove all items from the list. Similar to ``del a[:]``."
9594
msgstr "刪除 list 中所有項目。與 ``del a[:]`` 類似。"
9695

9796
#: ../../tutorial/datastructures.rst:64
98-
#, fuzzy
9997
msgid ""
10098
"Return zero-based index of the first occurrence of *value* in the list. "
10199
"Raises a :exc:`ValueError` if there is no such item."
102100
msgstr ""
103-
"回傳 list 中第一個出現 *x* 的(從零開始的)索引值。若 list 中無此項目,則丟"
104-
" :exc:`ValueError` 錯誤。"
101+
"回傳 list 中第一個出現 *value* 的(從零開始的)索引值。若 list 中無此項目,"
102+
"則丟出 :exc:`ValueError` 錯誤。"
105103

106104
#: ../../tutorial/datastructures.rst:67
107105
msgid ""
@@ -115,9 +113,8 @@ msgstr ""
115113
"而不是從 *start* 開始算。"
116114

117115
#: ../../tutorial/datastructures.rst:76
118-
#, fuzzy
119116
msgid "Return the number of times *value* appears in the list."
120-
msgstr "回傳 *x* 在 list 中所出現的次數。"
117+
msgstr "回傳 *value* 在 list 中所出現的次數。"
121118

122119
#: ../../tutorial/datastructures.rst:82
123120
msgid ""

tutorial/errors.po

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ msgstr ""
256256
"exception)*,執行將停止,並顯示錯誤訊息。"
257257

258258
#: ../../tutorial/errors.rst:120
259-
#, fuzzy
260259
msgid ""
261260
"A :keyword:`try` statement may have more than one *except clause*, to "
262261
"specify handlers for different exceptions. At most one handler will be "
@@ -267,15 +266,14 @@ msgstr ""
267266
":keyword:`try` 陳述式可以有不只一個 *except 子句*,為不同的例外指定處理者,而"
268267
"最多只有一個處理者會被執行。處理者只處理對應的 try 子句中發生的例外,而不會處"
269268
"理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句*\\ 可以"
270-
"用一組括號內的 tuple 列舉多個例外,例如: ::"
269+
"列舉多個例外,例如: ::"
271270

272271
#: ../../tutorial/errors.rst:126
273-
#, fuzzy
274272
msgid ""
275273
"... except RuntimeError, TypeError, NameError:\n"
276274
"... pass"
277275
msgstr ""
278-
"... except (RuntimeError, TypeError, NameError):\n"
276+
"... except RuntimeError, TypeError, NameError:\n"
279277
"... pass"
280278

281279
#: ../../tutorial/errors.rst:129
@@ -1102,7 +1100,6 @@ msgstr ""
11021100
"其他例外一樣被捕獲。 ::"
11031101

11041102
#: ../../tutorial/errors.rst:532
1105-
#, fuzzy
11061103
msgid ""
11071104
">>> def f():\n"
11081105
"... excs = [OSError('error 1'), SystemError('error 2')]\n"
@@ -1149,9 +1146,9 @@ msgstr ""
11491146
">>> try:\n"
11501147
"... f()\n"
11511148
"... except Exception as e:\n"
1152-
"... print(f'caught {type(e)}: e')\n"
1149+
"... print(f'caught {type(e)}: {e}')\n"
11531150
"...\n"
1154-
"caught <class 'ExceptionGroup'>: e\n"
1151+
"caught <class 'ExceptionGroup'>: there were problems (2 sub-exceptions)\n"
11551152
">>>"
11561153

11571154
#: ../../tutorial/errors.rst:557

tutorial/stdlib.po

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ msgstr ""
2626
"X-Generator: Poedit 3.0.1\n"
2727

2828
#: ../../tutorial/stdlib.rst:5
29-
#, fuzzy
3029
msgid "Brief tour of the standard library"
3130
msgstr "Python 標準函式庫概覽"
3231

3332
#: ../../tutorial/stdlib.rst:11
34-
#, fuzzy
3533
msgid "Operating system interface"
3634
msgstr "作業系統介面"
3735

@@ -110,7 +108,6 @@ msgstr ""
110108
"'installdir'"
111109

112110
#: ../../tutorial/stdlib.rst:51
113-
#, fuzzy
114111
msgid "File wildcards"
115112
msgstr "檔案之萬用字元 (File Wildcards)"
116113

@@ -132,7 +129,6 @@ msgstr ""
132129
"['primes.py', 'random.py', 'quote.py']"
133130

134131
#: ../../tutorial/stdlib.rst:64
135-
#, fuzzy
136132
msgid "Command-line arguments"
137133
msgstr "命令列引數"
138134

@@ -207,7 +203,6 @@ msgstr ""
207203
"'beta.txt']``。"
208204

209205
#: ../../tutorial/stdlib.rst:101
210-
#, fuzzy
211206
msgid "Error output redirection and program termination"
212207
msgstr "錯誤輸出重新導向與程式終止"
213208

@@ -233,7 +228,6 @@ msgid "The most direct way to terminate a script is to use ``sys.exit()``."
233228
msgstr "終止腳本最直接的方式就是利用 ``sys.exit()``。"
234229

235230
#: ../../tutorial/stdlib.rst:116
236-
#, fuzzy
237231
msgid "String pattern matching"
238232
msgstr "字串樣式比對"
239233

@@ -361,7 +355,6 @@ msgid ""
361355
msgstr "SciPy 專案 <https://scipy.org> 上也有許多數值計算相關的模組。"
362356

363357
#: ../../tutorial/stdlib.rst:179
364-
#, fuzzy
365358
msgid "Internet access"
366359
msgstr "網路存取"
367360

@@ -419,7 +412,6 @@ msgid "(Note that the second example needs a mailserver running on localhost.)"
419412
msgstr "(注意第二個例子中需要在本地端執行一個郵件伺服器。)"
420413

421414
#: ../../tutorial/stdlib.rst:210
422-
#, fuzzy
423415
msgid "Dates and times"
424416
msgstr "日期與時間"
425417

@@ -436,7 +428,6 @@ msgstr ""
436428
"作。模組也提供支援時區換算的類別。 ::"
437429

438430
#: ../../tutorial/stdlib.rst:218
439-
#, fuzzy
440431
msgid ""
441432
">>> # dates are easily constructed and formatted\n"
442433
">>> import datetime as dt\n"
@@ -453,21 +444,20 @@ msgid ""
453444
"14368"
454445
msgstr ""
455446
">>> # 能夠輕易建立與格式化\n"
456-
">>> from datetime import date\n"
457-
">>> now = date.today()\n"
447+
">>> import datetime as dt\n"
448+
">>> now = dt.date.today()\n"
458449
">>> now\n"
459450
"datetime.date(2003, 12, 2)\n"
460451
">>> now.strftime(\"%m-%d-%y. %d %b %Y is a %A on the %d day of %B.\")\n"
461452
"'12-02-03. 02 Dec 2003 is a Tuesday on the 02 day of December.'\n"
462453
"\n"
463454
">>> # 支援運算\n"
464-
">>> birthday = date(1964, 7, 31)\n"
455+
">>> birthday = dt.date(1964, 7, 31)\n"
465456
">>> age = now - birthday\n"
466457
">>> age.days\n"
467458
"14368"
468459

469460
#: ../../tutorial/stdlib.rst:236
470-
#, fuzzy
471461
msgid "Data compression"
472462
msgstr "資料壓縮"
473463

@@ -507,7 +497,6 @@ msgstr ""
507497
"226805979"
508498

509499
#: ../../tutorial/stdlib.rst:258
510-
#, fuzzy
511500
msgid "Performance measurement"
512501
msgstr "效能量測"
513502

@@ -554,7 +543,6 @@ msgstr ""
554543
"critical section) 的工具。"
555544

556545
#: ../../tutorial/stdlib.rst:282
557-
#, fuzzy
558546
msgid "Quality control"
559547
msgstr "品質控管"
560548

@@ -645,7 +633,6 @@ msgstr ""
645633
"unittest.main() # 從命令列呼叫會執行所有測試"
646634

647635
#: ../../tutorial/stdlib.rst:328
648-
#, fuzzy
649636
msgid "Batteries included"
650637
msgstr "標準模組庫"
651638

whatsnew/2.3.po

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,7 +2760,6 @@ msgid ""
27602760
msgstr ""
27612761

27622762
#: ../../whatsnew/2.3.rst:1713
2763-
#, fuzzy
27642763
msgid ""
27652764
">>> d = dt.datetime.now()\n"
27662765
">>> d\n"
@@ -2769,10 +2768,10 @@ msgid ""
27692768
"datetime.datetime(2001, 12, 30, 12, 15, 38, 827738)\n"
27702769
">>>"
27712770
msgstr ""
2772-
">>> d = datetime.datetime.now()\n"
2771+
">>> d = dt.datetime.now()\n"
27732772
">>> d\n"
27742773
"datetime.datetime(2002, 12, 30, 22, 15, 38, 827738)\n"
2775-
">>> d.replace(year=2001, hour = 12)\n"
2774+
">>> d.replace(year=2001, hour=12)\n"
27762775
"datetime.datetime(2001, 12, 30, 12, 15, 38, 827738)\n"
27772776
">>>"
27782777

whatsnew/2.5.po

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,17 +2071,16 @@ msgid ""
20712071
msgstr ""
20722072

20732073
#: ../../whatsnew/2.5.rst:1316
2074-
#, fuzzy
20752074
msgid ""
20762075
"import datetime as dt\n"
20772076
"\n"
20782077
"ts = dt.datetime.strptime('10:13:15 2006-03-07',\n"
20792078
" '%H:%M:%S %Y-%m-%d')"
20802079
msgstr ""
2081-
"from datetime import datetime\n"
2080+
"import datetime as dt\n"
20822081
"\n"
2083-
"ts = datetime.strptime('10:13:15 2006-03-07',\n"
2084-
" '%H:%M:%S %Y-%m-%d')"
2082+
"ts = dt.datetime.strptime('10:13:15 2006-03-07',\n"
2083+
" '%H:%M:%S %Y-%m-%d')"
20852084

20862085
#: ../../whatsnew/2.5.rst:1321
20872086
msgid ""

whatsnew/3.2.po

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,6 @@ msgid ""
15001500
msgstr ""
15011501

15021502
#: ../../whatsnew/3.2.rst:995
1503-
#, fuzzy
15041503
msgid ""
15051504
">>> import datetime as dt\n"
15061505
"\n"
@@ -1511,13 +1510,13 @@ msgid ""
15111510
">>> dt.datetime.strptime(\"01/01/2000 12:00 +0000\", \"%m/%d/%Y %H:%M %z\")\n"
15121511
"datetime.datetime(2000, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)"
15131512
msgstr ""
1514-
">>> from datetime import datetime, timezone\n"
1513+
">>> import datetime as dt\n"
15151514
"\n"
1516-
">>> datetime.now(timezone.utc)\n"
1515+
">>> dt.datetime.now(dt.timezone.utc)\n"
15171516
"datetime.datetime(2010, 12, 8, 21, 4, 2, 923754, tzinfo=datetime.timezone."
15181517
"utc)\n"
15191518
"\n"
1520-
">>> datetime.strptime(\"01/01/2000 12:00 +0000\", \"%m/%d/%Y %H:%M %z\")\n"
1519+
">>> dt.datetime.strptime(\"01/01/2000 12:00 +0000\", \"%m/%d/%Y %H:%M %z\")\n"
15211520
"datetime.datetime(2000, 1, 1, 12, 0, tzinfo=datetime.timezone.utc)"
15221521

15231522
#: ../../whatsnew/3.2.rst:1003

whatsnew/3.8.po

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,12 @@ msgid ""
373373
msgstr ""
374374

375375
#: ../../whatsnew/3.8.rst:271
376-
#, fuzzy
377376
msgid ""
378377
">>> delta = dt.date.today() - member_since\n"
379378
">>> f'{user=!s} {delta.days=:,d}'\n"
380379
"'user=eric_idle delta.days=16,075'"
381380
msgstr ""
382-
">>> delta = date.today() - member_since\n"
381+
">>> delta = dt.date.today() - member_since\n"
383382
">>> f'{user=!s} {delta.days=:,d}'\n"
384383
"'user=eric_idle delta.days=16,075'"
385384

whatsnew/3.9.po

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ msgid ""
423423
msgstr ""
424424

425425
#: ../../whatsnew/3.9.rst:284
426-
#, fuzzy
427426
msgid ""
428427
">>> from zoneinfo import ZoneInfo\n"
429428
">>> import datetime as dt\n"
@@ -444,21 +443,21 @@ msgid ""
444443
"PST"
445444
msgstr ""
446445
">>> from zoneinfo import ZoneInfo\n"
447-
">>> from datetime import datetime, timedelta\n"
446+
">>> import datetime as dt\n"
448447
"\n"
449448
">>> # 日光節約時間\n"
450-
">>> dt = datetime(2020, 10, 31, 12, tzinfo=ZoneInfo(\"America/"
449+
">>> when = dt.datetime(2020, 10, 31, 12, tzinfo=ZoneInfo(\"America/"
451450
"Los_Angeles\"))\n"
452-
">>> print(dt)\n"
451+
">>> print(when)\n"
453452
"2020-10-31 12:00:00-07:00\n"
454-
">>> dt.tzname()\n"
453+
">>> when.tzname()\n"
455454
"'PDT'\n"
456455
"\n"
457456
">>> # 標準時間\n"
458-
">>> dt += timedelta(days=7)\n"
459-
">>> print(dt)\n"
457+
">>> when += dt.timedelta(days=7)\n"
458+
">>> print(when)\n"
460459
"2020-11-07 12:00:00-08:00\n"
461-
">>> print(dt.tzname())\n"
460+
">>> print(when.tzname())\n"
462461
"PST"
463462

464463
#: ../../whatsnew/3.9.rst:302

0 commit comments

Comments
 (0)