@@ -1946,12 +1946,15 @@ msgid ""
19461946"patched, it no longer seemed practical to try to maintain the backwards "
19471947"compatibility."
19481948msgstr ""
1949+ "起初,:mod:`argparse` 曾经尝试通过 :mod:`optparse` 来维持兼容性。 但是,:mod:`optparse` "
1950+ "很难透明地扩展,特别是那些为支持新的 ``nargs=`` 描述方式和更好的用法消息所需的修改。当When most everything in "
1951+ ":mod:`optparse` 中几乎所有内容都已被复制粘贴或打上补丁时,维持向下兼容看来已是不切实际的。"
19491952
19501953#: ../../library/argparse.rst:2076
19511954msgid ""
19521955"The :mod:`argparse` module improves on the standard library :mod:`optparse` "
19531956"module in a number of ways including:"
1954- msgstr ""
1957+ msgstr ":mod:`argparse` 模块在许多方面对标准库的 :mod:`optparse` 模块进行了增强,包括: "
19551958
19561959#: ../../library/argparse.rst:2079
19571960msgid "Handling positional arguments."
@@ -1963,29 +1966,31 @@ msgstr "支持子命令。"
19631966
19641967#: ../../library/argparse.rst:2081
19651968msgid "Allowing alternative option prefixes like ``+`` and ``/``."
1966- msgstr ""
1969+ msgstr "允许替代选项前缀例如 ``+`` 和 ``/``。 "
19671970
19681971#: ../../library/argparse.rst:2082
19691972msgid "Handling zero-or-more and one-or-more style arguments."
1970- msgstr ""
1973+ msgstr "处理零个或多个以及一个或多个风格的参数。 "
19711974
19721975#: ../../library/argparse.rst:2083
19731976msgid "Producing more informative usage messages."
1974- msgstr ""
1977+ msgstr "生成更具信息量的用法消息。 "
19751978
19761979#: ../../library/argparse.rst:2084
19771980msgid "Providing a much simpler interface for custom ``type`` and ``action``."
1978- msgstr ""
1981+ msgstr "提供用于定制 ``type`` 和 ``action`` 的更为简单的接口。 "
19791982
19801983#: ../../library/argparse.rst:2086
19811984msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:"
1982- msgstr ""
1985+ msgstr "从 :mod:`optparse` 到 :mod:`argparse` 的部分升级路径: "
19831986
19841987#: ../../library/argparse.rst:2088
19851988msgid ""
19861989"Replace all :meth:`optparse.OptionParser.add_option` calls with "
19871990":meth:`ArgumentParser.add_argument` calls."
19881991msgstr ""
1992+ "将所有 :meth:`optparse.OptionParser.add_option` 调用替换为 "
1993+ ":meth:`ArgumentParser.add_argument` 调用。"
19891994
19901995#: ../../library/argparse.rst:2091
19911996msgid ""
@@ -1994,13 +1999,19 @@ msgid ""
19941999" calls for the positional arguments. Keep in mind that what was previously "
19952000"called ``options``, now in the :mod:`argparse` context is called ``args``."
19962001msgstr ""
2002+ "将 ``(options, args) = parser.parse_args()`` 替换为 ``args = "
2003+ "parser.parse_args()`` 并为位置参数添加额外的 :meth:`ArgumentParser.add_argument` 调用。 "
2004+ "请注意之前所谓的 ``options`` 在 :mod:`argparse` 上下文中被称为 ``args``。"
19972005
19982006#: ../../library/argparse.rst:2096
19992007msgid ""
20002008"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using "
20012009":meth:`~ArgumentParser.parse_intermixed_args` instead of "
20022010":meth:`~ArgumentParser.parse_args`."
20032011msgstr ""
2012+ "通过使用 :meth:`~ArgumentParser.parse_intermixed_args` 而非 "
2013+ ":meth:`~ArgumentParser.parse_args` 来替换 "
2014+ ":meth:`optparse.OptionParser.disable_interspersed_args`。"
20042015
20052016#: ../../library/argparse.rst:2100
20062017msgid ""
0 commit comments