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

Update translation for library/enum, library/exceptions and howto/sorting#1010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mattwang44 merged 5 commits intopython:3.13frommindihx:update-some-po
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 42 additions & 9 deletionshowto/sorting.po
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-03 11:11+0800\n"
"PO-Revision-Date:2023-08-12 15:09+0800\n"
"PO-Revision-Date:2024-12-20 19:16+0800\n"
"Last-Translator: Li-Hung Wang <li-hung@sciwork.dev>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
Expand DownExpand Up@@ -128,6 +128,8 @@ msgid ""
">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n"
"['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']"
msgstr ""
">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n"
"['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']"

#: ../../howto/sorting.rst:61
msgid ""
Expand DownExpand Up@@ -157,6 +159,13 @@ msgid ""
">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n"
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
msgstr ""
">>> student_tuples = [\n"
"... ('john', 'A', 15),\n"
"... ('jane', 'B', 12),\n"
"... ('dave', 'B', 10),\n"
"... ]\n"
">>> sorted(student_tuples, key=lambda student: student[2]) # 依照年齡排序\n"
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"

#: ../../howto/sorting.rst:79
msgid ""
Expand All@@ -182,6 +191,22 @@ msgid ""
"age\n"
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
msgstr ""
">>> class Student:\n"
"... def __init__(self, name, grade, age):\n"
"... self.name = name\n"
"... self.grade = grade\n"
"... self.age = age\n"
"... def __repr__(self):\n"
"... return repr((self.name, self.grade, self.age))\n"
"\n"
">>> student_objects = [\n"
"... Student('john', 'A', 15),\n"
"... Student('jane', 'B', 12),\n"
"... Student('dave', 'B', 10),\n"
"... ]\n"
">>> sorted(student_objects, key=lambda student: student.age) # 依照年齡排"
"序\n"
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"

#: ../../howto/sorting.rst:99
msgid ""
Expand DownExpand Up@@ -363,6 +388,10 @@ msgid ""
"primary key, descending\n"
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"
msgstr ""
">>> s = sorted(student_objects, key=attrgetter('age')) # 依照次要鍵排序\n"
">>> sorted(s, key=attrgetter('grade'), reverse=True) # 現在依照主要鍵降"
"冪排序\n"
"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]"

#: ../../howto/sorting.rst:193
msgid ""
Expand DownExpand Up@@ -436,6 +465,11 @@ msgid ""
">>> [student for grade, i, student in decorated] # undecorate\n"
"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]"
msgstr ""
">>> decorated = [(student.grade, i, student) for i, student in "
"enumerate(student_objects)]\n"
">>> decorated.sort()\n"
">>> [student for grade, i, student in decorated] # 移除裝飾\n"
"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]"

#: ../../howto/sorting.rst:231
msgid ""
Expand DownExpand Up@@ -532,7 +566,7 @@ msgstr ""

#: ../../howto/sorting.rst:273
msgid "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order"
msgstr ""
msgstr "sorted(words, key=cmp_to_key(strcoll)) # 理解語系的排序順序"

#: ../../howto/sorting.rst:276
msgid "Odds and Ends"
Expand DownExpand Up@@ -605,10 +639,10 @@ msgid ""
"six comparison methods be implemented. The :func:`~functools.total_ordering` "
"decorator is provided to make that task easier."
msgstr ""
"然而,請注意,當 :meth:`~object.__lt__`沒有被實做時,``<`` 可以回退 (fall "
"然而,請注意,當 :meth:`~object.__lt__`沒有被實作時,``<`` 可以回退 (fall "
"back) 使用 :meth:`~object.__gt__`\\ (有關技術上的細節資訊請看 :func:`object."
"__lt__` )。為了避免意外發生,:pep:`8` 建議所有六種的比較函式都需要被實作。裝飾"
" :func:`~functools.total_ordering` 被提供用來讓任務更為簡單。"
"__lt__` )。為了避免意外發生,:pep:`8` 建議所有六種的比較函式都需要被實作。"
"飾器 :func:`~functools.total_ordering` 被提供用來讓任務更為簡單。"

#: ../../howto/sorting.rst:314
msgid ""
Expand DownExpand Up@@ -672,7 +706,6 @@ msgid ""
"position ``0``. These functions are suitable for implementing priority "
"queues which are commonly used for task scheduling."
msgstr ""
":func:`heapq.heappush` 和 :func:`heapq.heappop` 會建立並維持一個部份排序的資料"
"排列,將最小的元素保持在位置 ``0``。這些函式適合用來實作常用於任務排程的優先"
"佇列。"

":func:`heapq.heappush` 和 :func:`heapq.heappop` 會建立並維持一個部份排序的資"
"料排列,將最小的元素保持在位置 ``0``。這些函式適合用來實作常用於任務排程的優"
"先佇列。"
Loading

[8]ページ先頭

©2009-2025 Movatter.jp