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

Commit3a7839f

Browse files
committed
sync with cpython aea2e03b
1 parent4f92e39 commit3a7839f

File tree

12 files changed

+2677
-2265
lines changed

12 files changed

+2677
-2265
lines changed

‎c-api/object.po

Lines changed: 87 additions & 86 deletions
Large diffs are not rendered by default.

‎howto/argparse-optparse.po

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version:Python 3.13\n"
88
"Report-Msgid-Bugs-To:\n"
9-
"POT-Creation-Date:2024-10-09 00:13+0000\n"
9+
"POT-Creation-Date:2024-12-29 18:06+0800\n"
1010
"PO-Revision-Date:YEAR-MO-DA HO:MI+ZONE\n"
1111
"Last-Translator:FULL NAME <EMAIL@ADDRESS>\n"
1212
"Language-Team:Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -16,101 +16,118 @@ msgstr ""
1616
"Content-Type:text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding:8bit\n"
1818

19-
#:../../howto/argparse-optparse.rst:7
20-
msgid"Upgrading optparse code"
19+
#:../../howto/argparse-optparse.rst:8
20+
#,fuzzy
21+
msgid"Migrating ``optparse`` code to ``argparse``"
2122
msgstr"升級 optparse 程式碼"
2223

23-
#:../../howto/argparse-optparse.rst:9
24-
msgid""
25-
"Originally, the :mod:`argparse` module had attempted to maintain "
26-
"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult "
27-
"to extend transparently, particularly with the changes required to support "
28-
"``nargs=`` specifiers and better usage messages. When most everything in :"
29-
"mod:`optparse` had either been copy-pasted over or monkey-patched, it no "
30-
"longer seemed practical to try to maintain the backwards compatibility."
31-
msgstr""
32-
33-
#:../../howto/argparse-optparse.rst:16
24+
#:../../howto/argparse-optparse.rst:10
3425
msgid""
35-
"The :mod:`argparse` moduleimproves on the :mod:`optparse` module in a "
36-
"number of ways including:"
26+
"The :mod:`argparse` moduleoffers several higher level features not natively "
27+
"provided by the :mod:`optparse` module, including:"
3728
msgstr""
3829

39-
#:../../howto/argparse-optparse.rst:19
30+
#:../../howto/argparse-optparse.rst:13
4031
msgid"Handling positional arguments."
4132
msgstr""
4233

43-
#:../../howto/argparse-optparse.rst:20
34+
#:../../howto/argparse-optparse.rst:14
4435
msgid"Supporting subcommands."
4536
msgstr""
4637

47-
#:../../howto/argparse-optparse.rst:21
38+
#:../../howto/argparse-optparse.rst:15
4839
msgid"Allowing alternative option prefixes like ``+`` and ``/``."
4940
msgstr""
5041

51-
#:../../howto/argparse-optparse.rst:22
42+
#:../../howto/argparse-optparse.rst:16
5243
msgid"Handling zero-or-more and one-or-more style arguments."
5344
msgstr""
5445

55-
#:../../howto/argparse-optparse.rst:23
46+
#:../../howto/argparse-optparse.rst:17
5647
msgid"Producing more informative usage messages."
5748
msgstr""
5849

59-
#:../../howto/argparse-optparse.rst:24
50+
#:../../howto/argparse-optparse.rst:18
6051
msgid"Providing a much simpler interface for custom ``type`` and ``action``."
6152
msgstr""
6253

63-
#:../../howto/argparse-optparse.rst:26
64-
msgid"A partial upgrade path from :mod:`optparse` to :mod:`argparse`:"
54+
#:../../howto/argparse-optparse.rst:20
55+
msgid""
56+
"Originally, the :mod:`argparse` module attempted to maintain compatibility "
57+
"with :mod:`optparse`. However, the fundamental design differences between "
58+
"supporting declarative command line option processing (while leaving "
59+
"positional argument processing to application code), and supporting both "
60+
"named options and positional arguments in the declarative interface mean "
61+
"that the API has diverged from that of ``optparse`` over time."
62+
msgstr""
63+
64+
#:../../howto/argparse-optparse.rst:27
65+
msgid""
66+
"As described in :ref:`choosing-an-argument-parser`, applications that are "
67+
"currently using :mod:`optparse` and are happy with the way it works can just "
68+
"continue to use ``optparse``."
69+
msgstr""
70+
71+
#:../../howto/argparse-optparse.rst:31
72+
msgid""
73+
"Application developers that are considering migrating should also review the "
74+
"list of intrinsic behavioural differences described in that section before "
75+
"deciding whether or not migration is desirable."
76+
msgstr""
77+
78+
#:../../howto/argparse-optparse.rst:35
79+
msgid""
80+
"For applications that do choose to migrate from :mod:`optparse` to :mod:"
81+
"`argparse`, the following suggestions should be helpful:"
6582
msgstr""
6683

67-
#:../../howto/argparse-optparse.rst:28
84+
#:../../howto/argparse-optparse.rst:38
6885
msgid""
6986
"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:"
7087
"`ArgumentParser.add_argument` calls."
7188
msgstr""
7289

73-
#:../../howto/argparse-optparse.rst:31
90+
#:../../howto/argparse-optparse.rst:41
7491
msgid""
7592
"Replace ``(options, args) = parser.parse_args()`` with ``args = parser."
7693
"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls "
7794
"for the positional arguments. Keep in mind that what was previously called "
7895
"``options``, now in the :mod:`argparse` context is called ``args``."
7996
msgstr""
8097

81-
#:../../howto/argparse-optparse.rst:36
98+
#:../../howto/argparse-optparse.rst:46
8299
msgid""
83100
"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :"
84101
"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:"
85102
"`~ArgumentParser.parse_args`."
86103
msgstr""
87104

88-
#:../../howto/argparse-optparse.rst:40
105+
#:../../howto/argparse-optparse.rst:50
89106
msgid""
90107
"Replace callback actions and the ``callback_*`` keyword arguments with "
91108
"``type`` or ``action`` arguments."
92109
msgstr""
93110

94-
#:../../howto/argparse-optparse.rst:43
111+
#:../../howto/argparse-optparse.rst:53
95112
msgid""
96113
"Replace string names for ``type`` keyword arguments with the corresponding "
97114
"type objects (e.g. int, float, complex, etc)."
98115
msgstr""
99116

100-
#:../../howto/argparse-optparse.rst:46
117+
#:../../howto/argparse-optparse.rst:56
101118
msgid""
102119
"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse."
103120
"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`."
104121
msgstr""
105122

106-
#:../../howto/argparse-optparse.rst:50
123+
#:../../howto/argparse-optparse.rst:60
107124
msgid""
108125
"Replace strings with implicit arguments such as ``%default`` or ``%prog`` "
109126
"with the standard Python syntax to use dictionaries to format strings, that "
110127
"is, ``%(default)s`` and ``%(prog)s``."
111128
msgstr""
112129

113-
#:../../howto/argparse-optparse.rst:54
130+
#:../../howto/argparse-optparse.rst:64
114131
msgid""
115132
"Replace the OptionParser constructor ``version`` argument with a call to "
116133
"``parser.add_argument('--version', action='version', version='<the "

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp