# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # Rafael Fontenelle , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-07-25 16:03+0000\n" "PO-Revision-Date: 2025-07-18 19:57+0000\n" "Last-Translator: Rafael Fontenelle , 2025\n" "Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/__future__.rst:2 msgid ":mod:`!__future__` --- Future statement definitions" msgstr ":mod:`!__future__` --- Future 语句定义" #: ../../library/__future__.rst:7 msgid "**Source code:** :source:`Lib/__future__.py`" msgstr "**源代码:** :source:`Lib/__future__.py`" #: ../../library/__future__.rst:11 msgid "" "Imports of the form ``from __future__ import feature`` are called " ":ref:`future statements `. These are special-cased by the Python " "compiler to allow the use of new Python features in modules containing the " "future statement before the release in which the feature becomes standard." msgstr "" "``from __future__ import feature`` 形式的导入被称为 :ref:`future 语句 `。 它们会被 " "Python 编译器当作特例,通过包含 future 语句来允许新的 Python 特性在该特性成为语言标准之前发布的模块中使用。" #: ../../library/__future__.rst:16 msgid "" "While these future statements are given additional special meaning by the " "Python compiler, they are still executed like any other import statement and" " the :mod:`__future__` exists and is handled by the import system the same " "way any other Python module would be. This design serves three purposes:" msgstr "" "虽然这些future 语句被 Python 编译器赋予了额外的特殊含义,但它们仍然像会其他导入语句一样被执行,而 :mod:`__future__` " "的存在和被导入系统处理的方式与其他任何 Python 模块的相同。 这种设计有三个目的:" #: ../../library/__future__.rst:21 msgid "" "To avoid confusing existing tools that analyze import statements and expect " "to find the modules they're importing." msgstr "避免混淆已有的分析 import 语句并查找 import 的模块的工具。" #: ../../library/__future__.rst:24 msgid "" "To document when incompatible changes were introduced, and when they will be" " --- or were --- made mandatory. This is a form of executable " "documentation, and can be inspected programmatically via importing " ":mod:`__future__` and examining its contents." msgstr "" "当引入不兼容的修改时,可以记录其引入的时间以及强制使用的时间。这是一种可执行的文档,并且可以通过 import :mod:`__future__` " "来做程序性的检查。" #: ../../library/__future__.rst:29 msgid "" "To ensure that :ref:`future statements ` run under releases prior to" " Python 2.1 at least yield runtime exceptions (the import of " ":mod:`__future__` will fail, because there was no module of that name prior " "to 2.1)." msgstr "" "确保 :ref:`future 语句 ` 在 Python 2.1 之前的发布版上运行时至少能抛出运行时异常(对 " ":mod:`__future__` 的导入将失败,因为will fail, because there was no module of that " "name prior to 2.1 之前没有这个模块名称)。" #: ../../library/__future__.rst:34 msgid "Module Contents" msgstr "模块内容" #: ../../library/__future__.rst:36 msgid "" "No feature description will ever be deleted from :mod:`__future__`. Since " "its introduction in Python 2.1 the following features have found their way " "into the language using this mechanism:" msgstr ":mod:`__future__` 中不会删除特性的描述。从 Python 2.1 中首次加入以来,通过这种方式引入了以下特性:" #: ../../library/__future__.rst:41 msgid "feature" msgstr "特性" #: ../../library/__future__.rst:41 msgid "optional in" msgstr "可选版本" #: ../../library/__future__.rst:41 msgid "mandatory in" msgstr "强制加入版本" #: ../../library/__future__.rst:41 msgid "effect" msgstr "效果" #: ../../library/__future__.rst:43 msgid "nested_scopes" msgstr "nested_scopes" #: ../../library/__future__.rst:43 msgid "2.1.0b1" msgstr "2.1.0b1" #: ../../library/__future__.rst:43 msgid "2.2" msgstr "2.2" #: ../../library/__future__.rst:43 msgid ":pep:`227`: *Statically Nested Scopes*" msgstr ":pep:`227`: *静态嵌套作用域*" #: ../../library/__future__.rst:46 msgid "generators" msgstr "generators" #: ../../library/__future__.rst:46 msgid "2.2.0a1" msgstr "2.2.0a1" #: ../../library/__future__.rst:46 msgid "2.3" msgstr "2.3" #: ../../library/__future__.rst:46 msgid ":pep:`255`: *Simple Generators*" msgstr ":pep:`255`: *简单生成器*" #: ../../library/__future__.rst:49 msgid "division" msgstr "division" #: ../../library/__future__.rst:49 msgid "2.2.0a2" msgstr "2.2.0a2" #: ../../library/__future__.rst:49 ../../library/__future__.rst:52 #: ../../library/__future__.rst:58 ../../library/__future__.rst:61 msgid "3.0" msgstr "3.0" #: ../../library/__future__.rst:49 msgid ":pep:`238`: *Changing the Division Operator*" msgstr ":pep:`238`: *修改除法运算符*" #: ../../library/__future__.rst:52 msgid "absolute_import" msgstr "absolute_import" #: ../../library/__future__.rst:52 ../../library/__future__.rst:55 msgid "2.5.0a1" msgstr "2.5.0a1" #: ../../library/__future__.rst:52 msgid ":pep:`328`: *Imports: Multi-Line and Absolute/Relative*" msgstr ":pep:`328`: *导入:多行与绝对/相对*" #: ../../library/__future__.rst:55 msgid "with_statement" msgstr "with_statement" #: ../../library/__future__.rst:55 msgid "2.6" msgstr "2.6" #: ../../library/__future__.rst:55 msgid ":pep:`343`: *The \"with\" Statement*" msgstr ":pep:`343`: * \"with\" 语句*" #: ../../library/__future__.rst:58 msgid "print_function" msgstr "print_function" #: ../../library/__future__.rst:58 ../../library/__future__.rst:61 msgid "2.6.0a2" msgstr "2.6.0a2" #: ../../library/__future__.rst:58 msgid ":pep:`3105`: *Make print a function*" msgstr ":pep:`3105`: *print 改为函数*" #: ../../library/__future__.rst:61 msgid "unicode_literals" msgstr "unicode_literals" #: ../../library/__future__.rst:61 msgid ":pep:`3112`: *Bytes literals in Python 3000*" msgstr ":pep:`3112`: *Python 3000 中的字节字面值*" #: ../../library/__future__.rst:64 msgid "generator_stop" msgstr "generator_stop" #: ../../library/__future__.rst:64 msgid "3.5.0b1" msgstr "3.5.0b1" #: ../../library/__future__.rst:64 msgid "3.7" msgstr "3.7" #: ../../library/__future__.rst:64 msgid ":pep:`479`: *StopIteration handling inside generators*" msgstr ":pep:`479`: *在生成器中处理 StopIteration*" #: ../../library/__future__.rst:67 msgid "annotations" msgstr "annotations" #: ../../library/__future__.rst:67 msgid "3.7.0b1" msgstr "3.7.0b1" #: ../../library/__future__.rst:67 msgid "TBD [1]_" msgstr "TBD [1]_" #: ../../library/__future__.rst:67 msgid ":pep:`563`: *Postponed evaluation of annotations*" msgstr ":pep:`563`: *Postponed evaluation of annotations*" #: ../../library/__future__.rst:77 msgid "Each statement in :file:`__future__.py` is of the form::" msgstr ":file:`__future__.py` 中的每一条语句都是以下格式的:" #: ../../library/__future__.rst:79 msgid "" "FeatureName = _Feature(OptionalRelease, MandatoryRelease,\n" " CompilerFlag)" msgstr "" "FeatureName = _Feature(OptionalRelease, MandatoryRelease,\n" " CompilerFlag)" #: ../../library/__future__.rst:82 msgid "" "where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both" " are 5-tuples of the same form as :data:`sys.version_info`::" msgstr "" "通常 *OptionalRelease* 要比 *MandatoryRelease* 小,并且都是和 :data:`sys.version_info` " "格式一致的 5 元素元组。" #: ../../library/__future__.rst:85 msgid "" "(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int\n" " PY_MINOR_VERSION, # the 1; an int\n" " PY_MICRO_VERSION, # the 0; an int\n" " PY_RELEASE_LEVEL, # \"alpha\", \"beta\", \"candidate\" or \"final\"; string\n" " PY_RELEASE_SERIAL # the 3; an int\n" ")" msgstr "" "(PY_MAJOR_VERSION, # 2.1.0a3 中的 2; 一个整数\n" " PY_MINOR_VERSION, # 1; 一个整数\n" " PY_MICRO_VERSION, # 0; 一个整数\n" " PY_RELEASE_LEVEL, # \"alpha\", \"beta\", \"candidate\" 或 \"final\"; 字符串\n" " PY_RELEASE_SERIAL # 3; 一个整数\n" ")" #: ../../library/__future__.rst:94 msgid "" "*OptionalRelease* records the first release in which the feature was " "accepted." msgstr "*OptionalRelease* 记录了一个特性首次发布时的 Python 版本。" #: ../../library/__future__.rst:98 msgid "" "In the case of a *MandatoryRelease* that has not yet occurred, " "*MandatoryRelease* predicts the release in which the feature will become " "part of the language." msgstr "在 *MandatoryRelases* 还没有发布时,*MandatoryRelease* 表示该特性会变成语言的一部分的预测时间。" #: ../../library/__future__.rst:102 msgid "" "Else *MandatoryRelease* records when the feature became part of the " "language; in releases at or after that, modules no longer need a future " "statement to use the feature in question, but may continue to use such " "imports." msgstr "" "其他情况下,*MandatoryRelease* 用来记录这个特性是何时成为语言的一部分的。从该版本往后,使用该特性将不需要 future " "语句,不过很多人还是会加上对应的 import。" #: ../../library/__future__.rst:106 msgid "" "*MandatoryRelease* may also be ``None``, meaning that a planned feature got " "dropped or that it is not yet decided." msgstr "*MandatoryRelease* 也可能为 ``None``,表示计划中的特性被撤销或尚未确定。" #: ../../library/__future__.rst:111 msgid "" "*CompilerFlag* is the (bitfield) flag that should be passed in the fourth " "argument to the built-in function :func:`compile` to enable the feature in " "dynamically compiled code. This flag is stored in the " ":attr:`_Feature.compiler_flag` attribute on :class:`_Feature` instances." msgstr "" "*CompilerFlag* 是一个(位)旗标,对于动态编译的代码应当将其作为第四个参数传给内置函数 :func:`compile` 以启用相应的特性。" " 该旗标存储在 :class:`_Feature` 实例的 :attr:`_Feature.compiler_flag` 属性中。" #: ../../library/__future__.rst:117 msgid "" "``from __future__ import annotations`` was previously scheduled to become " "mandatory in Python 3.10, but the Python Steering Council twice decided to " "delay the change (`announcement for Python 3.10 " "`__; `announcement " "for Python 3.11 `__). No final " "decision has been made yet. See also :pep:`563` and :pep:`649`." msgstr "" "先前计划在 Python 3.10 中强制使用 ``from __future__ import annotations`` " ",但Python指导委员会两次决定推迟这一改变( `Python 3.10 的公告 " "`__ ; `Python 3.11 " "的公告 `__ " ")。目前还没有做出最终决定。参见 :pep:`563` 和 :pep:`649` 。" #: ../../library/__future__.rst:127 msgid ":ref:`future`" msgstr ":ref:`future`" #: ../../library/__future__.rst:128 msgid "How the compiler treats future imports." msgstr "编译器怎样处理 future import。" #: ../../library/__future__.rst:130 msgid ":pep:`236` - Back to the __future__" msgstr ":pep:`236` - 回到 __future__" #: ../../library/__future__.rst:131 msgid "The original proposal for the __future__ mechanism." msgstr "有关 __future__ 机制的最初提议。"