diff --git a/faq/windows.po b/faq/windows.po index 6efd39f547..33b20afcc6 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-09-24 00:21+0000\n" "PO-Revision-Date: 2022-06-30 23:53+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -118,8 +118,8 @@ msgid "" "prompt." msgstr "" "許多人將互動模式作為方便但可高度程式化的計算機。如果你要結束互動式 Python 對" -"話,請呼叫 :func:`exit` 函式或是按住 :kbd:`Ctrl` 鍵再輸入 :kbd:`Z`,然後按" -"下 \":kbd:`Enter`\" 鍵以返回 Windows 命令提示字元。" +"話,請呼叫 :func:`exit` 函式或是按住 :kbd:`Ctrl` 鍵再輸入 :kbd:`Z`,然後按下 " +"\":kbd:`Enter`\" 鍵以返回 Windows 命令提示字元。" #: ../../faq/windows.rst:90 msgid "" @@ -130,11 +130,11 @@ msgid "" "Z` character; Windows is running a single \"python\" command in the window, " "and closes it when you terminate the interpreter." msgstr "" -"你可能還會發現你有一個開始功能表項目,像是::menuselection:`開始 --> 所有" -"程式 --> Python 3.x --> Python(命令行)`,它會讓你在一個新視窗中看到 " -"``>>>`` 提示字元。如果是這樣,該視窗將在你呼叫 :func:`exit` 函式或輸入 :kbd:" -"`Ctrl-Z` 字元後消失;Windows 正在該視窗中運行單一個「python」命令,並在你終止" -"直譯器時將其關閉。" +"你可能還會發現你有一個開始功能表項目,像是::menuselection:`開始 --> 所有程" +"式 --> Python 3.x --> Python(命令行)`,它會讓你在一個新視窗中看到 ``>>>`` " +"提示字元。如果是這樣,該視窗將在你呼叫 :func:`exit` 函式或輸入 :kbd:`Ctrl-Z` " +"字元後消失;Windows 正在該視窗中運行單一個「python」命令,並在你終止直譯器時" +"將其關閉。" #: ../../faq/windows.rst:97 msgid "" @@ -435,8 +435,8 @@ msgid "" "radio button." msgstr "" "在任何編輯器下,將 tab 和空格混合都是一個壞主意。MSVC 在這方面也是一樣,且可" -"以輕鬆配置為使用空格:選擇\\ :menuselection:`工具 --> 選項 --> Tabs`,然後" -"對於「預設」檔案類型,將「Tab 大小」和「縮排大小」設定為 4,然後選擇「插入空" +"以輕鬆配置為使用空格:選擇\\ :menuselection:`工具 --> 選項 --> Tabs`,然後對" +"於「預設」檔案類型,將「Tab 大小」和「縮排大小」設定為 4,然後選擇「插入空" "格」單選鈕。" #: ../../faq/windows.rst:267 @@ -463,6 +463,19 @@ msgstr "" "式 ``kbhit()``,該函式會檢查是否出現鍵盤打擊 (keyboard hit),以及函式 " "``getch()``,該函式會取得一個字元且不會將其印出。" +#: ../../faq/windows.rst:281 +msgid "How do I solve the missing api-ms-win-crt-runtime-l1-1-0.dll error?" +msgstr "" + +#: ../../faq/windows.rst:283 +msgid "" +"This can occur on Python 3.5 and later when using Windows 8.1 or earlier " +"without all updates having been installed. First ensure your operating " +"system is supported and is up to date, and if that does not resolve the " +"issue, visit the `Microsoft support page `_ for guidance on manually installing the C Runtime update." +msgstr "" + #~ msgid "or::" #~ msgstr "" #~ "或是:\n" diff --git a/library/logging.po b/library/logging.po index 87d4a5179a..f9fd26d5e0 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-09 00:20+0000\n" +"POT-Creation-Date: 2022-09-21 00:21+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -268,7 +268,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:189 ../../library/logging.rst:1050 +#: ../../library/logging.rst:189 ../../library/logging.rst:1066 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -280,14 +280,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:198 ../../library/logging.rst:1059 +#: ../../library/logging.rst:198 ../../library/logging.rst:1075 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:206 ../../library/logging.rst:1067 +#: ../../library/logging.rst:206 ../../library/logging.rst:1083 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -336,7 +336,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:246 ../../library/logging.rst:1098 +#: ../../library/logging.rst:246 ../../library/logging.rst:1114 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -354,7 +354,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:257 ../../library/logging.rst:1109 +#: ../../library/logging.rst:257 ../../library/logging.rst:1125 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -666,14 +666,39 @@ msgstr "" #: ../../library/logging.rst:525 msgid "" +"This method is called after a handler-level lock is acquired, which is " +"released after this method returns. When you override this method, note that " +"you should be careful when calling anything that invokes other parts of the " +"logging API which might do locking, because that might result in a deadlock. " +"Specifically:" +msgstr "" + +#: ../../library/logging.rst:531 +msgid "" +"Logging configuration APIs acquire the module-level lock, and then " +"individual handler-level locks as those handlers are configured." +msgstr "" + +#: ../../library/logging.rst:534 +msgid "" +"Many logging APIs lock the module-level lock. If such an API is called from " +"this method, it could cause a deadlock if a configuration call is made on " +"another thread, because that thread will try to acquire the module-level " +"lock *before* the handler-level lock, whereas this thread tries to acquire " +"the module-level lock *after* the handler-level lock (because in this " +"method, the handler-level lock has already been acquired)." +msgstr "" + +#: ../../library/logging.rst:541 +msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:530 +#: ../../library/logging.rst:546 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:534 +#: ../../library/logging.rst:550 msgid "" ":class:`Formatter` objects have the following attributes and methods. They " "are responsible for converting a :class:`LogRecord` to (usually) a string " @@ -684,7 +709,7 @@ msgid "" "information in the formatted output (such as a timestamp), keep reading." msgstr "" -#: ../../library/logging.rst:542 +#: ../../library/logging.rst:558 msgid "" "A Formatter can be initialized with a format string which makes use of " "knowledge of the :class:`LogRecord` attributes - such as the default value " @@ -694,13 +719,13 @@ msgid "" "ref:`old-string-formatting` for more information on string formatting." msgstr "" -#: ../../library/logging.rst:549 +#: ../../library/logging.rst:565 msgid "" "The useful mapping keys in a :class:`LogRecord` are given in the section on :" "ref:`logrecord-attributes`." msgstr "" -#: ../../library/logging.rst:555 +#: ../../library/logging.rst:571 msgid "" "Returns a new instance of the :class:`Formatter` class. The instance is " "initialized with a format string for the message as a whole, as well as a " @@ -709,7 +734,7 @@ msgid "" "format is used which is described in the :meth:`formatTime` documentation." msgstr "" -#: ../../library/logging.rst:561 +#: ../../library/logging.rst:577 msgid "" "The *style* parameter can be one of '%', '{' or '$' and determines how the " "format string will be merged with its data: using one of %-formatting, :meth:" @@ -719,29 +744,29 @@ msgid "" "for more information on using {- and $-formatting for log messages." msgstr "" -#: ../../library/logging.rst:569 +#: ../../library/logging.rst:585 msgid "" "The *defaults* parameter can be a dictionary with default values to use in " "custom fields. For example: ``logging.Formatter('%(ip)s %(message)s', " "defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:573 +#: ../../library/logging.rst:589 msgid "The *style* parameter was added." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:576 +#: ../../library/logging.rst:592 msgid "" "The *validate* parameter was added. Incorrect or mismatched style and fmt " "will raise a ``ValueError``. For example: ``logging.Formatter('%(asctime)s - " "%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:581 +#: ../../library/logging.rst:597 msgid "The *defaults* parameter was added." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:586 +#: ../../library/logging.rst:602 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -760,13 +785,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:602 +#: ../../library/logging.rst:618 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:608 +#: ../../library/logging.rst:624 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " @@ -779,7 +804,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:618 +#: ../../library/logging.rst:634 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -789,7 +814,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:626 +#: ../../library/logging.rst:642 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -804,11 +829,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:639 +#: ../../library/logging.rst:655 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:644 +#: ../../library/logging.rst:660 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -816,14 +841,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:651 +#: ../../library/logging.rst:667 msgid "" "Formats the specified stack information (a string as returned by :func:" "`traceback.print_stack`, but with the last newline removed) as a string. " "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:657 +#: ../../library/logging.rst:673 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -832,7 +857,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:665 +#: ../../library/logging.rst:681 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -840,14 +865,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:672 +#: ../../library/logging.rst:688 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:679 +#: ../../library/logging.rst:695 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -855,11 +880,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:687 +#: ../../library/logging.rst:703 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:689 +#: ../../library/logging.rst:705 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -869,7 +894,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:699 +#: ../../library/logging.rst:715 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -877,13 +902,13 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:706 +#: ../../library/logging.rst:722 msgid "" "Is the specified record to be logged? Returns zero for no, nonzero for yes. " "If deemed appropriate, the record may be modified in-place by this method." msgstr "" -#: ../../library/logging.rst:710 +#: ../../library/logging.rst:726 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -893,13 +918,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:717 +#: ../../library/logging.rst:733 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:720 +#: ../../library/logging.rst:736 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -910,7 +935,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:730 +#: ../../library/logging.rst:746 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -922,11 +947,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:743 +#: ../../library/logging.rst:759 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:745 +#: ../../library/logging.rst:761 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -934,11 +959,11 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:753 +#: ../../library/logging.rst:769 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:755 +#: ../../library/logging.rst:771 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." @@ -948,7 +973,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:759 +#: ../../library/logging.rst:775 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -956,7 +981,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:767 +#: ../../library/logging.rst:783 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -964,45 +989,45 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:774 +#: ../../library/logging.rst:790 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:778 +#: ../../library/logging.rst:794 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:782 +#: ../../library/logging.rst:798 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data." msgstr "" -#: ../../library/logging.rst:786 +#: ../../library/logging.rst:802 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:790 +#: ../../library/logging.rst:806 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:795 +#: ../../library/logging.rst:811 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:799 +#: ../../library/logging.rst:815 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:806 +#: ../../library/logging.rst:822 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1011,7 +1036,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:813 +#: ../../library/logging.rst:829 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1019,24 +1044,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:819 +#: ../../library/logging.rst:835 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:831 +#: ../../library/logging.rst:847 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:856 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:842 +#: ../../library/logging.rst:858 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1047,7 +1072,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:866 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1055,7 +1080,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:856 +#: ../../library/logging.rst:872 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1064,308 +1089,308 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:863 +#: ../../library/logging.rst:879 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:863 ../../library/logging.rst:1246 +#: ../../library/logging.rst:879 ../../library/logging.rst:1262 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:863 ../../library/logging.rst:1246 +#: ../../library/logging.rst:879 ../../library/logging.rst:1262 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:865 +#: ../../library/logging.rst:0 ../../library/logging.rst:881 msgid "args" msgstr "" -#: ../../library/logging.rst:865 ../../library/logging.rst:879 -#: ../../library/logging.rst:907 ../../library/logging.rst:925 +#: ../../library/logging.rst:881 ../../library/logging.rst:895 +#: ../../library/logging.rst:923 ../../library/logging.rst:941 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:865 +#: ../../library/logging.rst:881 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:870 +#: ../../library/logging.rst:886 msgid "asctime" msgstr "" -#: ../../library/logging.rst:870 +#: ../../library/logging.rst:886 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:870 +#: ../../library/logging.rst:886 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:876 +#: ../../library/logging.rst:892 msgid "created" msgstr "" -#: ../../library/logging.rst:876 +#: ../../library/logging.rst:892 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:876 +#: ../../library/logging.rst:892 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:879 +#: ../../library/logging.rst:0 ../../library/logging.rst:895 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:879 +#: ../../library/logging.rst:895 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:882 +#: ../../library/logging.rst:898 msgid "filename" msgstr "" -#: ../../library/logging.rst:882 +#: ../../library/logging.rst:898 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:882 +#: ../../library/logging.rst:898 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:900 msgid "funcName" msgstr "" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:900 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:884 +#: ../../library/logging.rst:900 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:902 msgid "levelname" msgstr "" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:902 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:902 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:906 msgid "levelno" msgstr "" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:906 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:906 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:895 +#: ../../library/logging.rst:911 msgid "lineno" msgstr "" -#: ../../library/logging.rst:895 +#: ../../library/logging.rst:911 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:895 +#: ../../library/logging.rst:911 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:914 msgid "message" msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:914 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:914 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:918 msgid "module" msgstr "模組" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:918 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:918 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:920 msgid "msecs" msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:920 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:920 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:907 +#: ../../library/logging.rst:0 ../../library/logging.rst:923 msgid "msg" msgstr "" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:923 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:912 +#: ../../library/logging.rst:0 ../../library/logging.rst:928 msgid "name" msgstr "" -#: ../../library/logging.rst:912 +#: ../../library/logging.rst:928 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:912 +#: ../../library/logging.rst:928 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:930 msgid "pathname" msgstr "" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:930 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:930 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:917 +#: ../../library/logging.rst:933 msgid "process" msgstr "" -#: ../../library/logging.rst:917 +#: ../../library/logging.rst:933 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:917 +#: ../../library/logging.rst:933 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:935 msgid "processName" msgstr "" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:935 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:935 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:921 +#: ../../library/logging.rst:937 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:921 +#: ../../library/logging.rst:937 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:921 +#: ../../library/logging.rst:937 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:925 +#: ../../library/logging.rst:941 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:925 +#: ../../library/logging.rst:941 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:947 msgid "thread" msgstr "" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:947 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:931 +#: ../../library/logging.rst:947 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:949 msgid "threadName" msgstr "" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:949 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:949 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:936 +#: ../../library/logging.rst:952 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:943 +#: ../../library/logging.rst:959 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:945 +#: ../../library/logging.rst:961 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:951 +#: ../../library/logging.rst:967 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:956 +#: ../../library/logging.rst:972 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1374,7 +1399,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:962 +#: ../../library/logging.rst:978 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1386,24 +1411,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:971 +#: ../../library/logging.rst:987 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:976 +#: ../../library/logging.rst:992 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:982 +#: ../../library/logging.rst:998 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:984 +#: ../../library/logging.rst:1000 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1412,7 +1437,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:989 +#: ../../library/logging.rst:1005 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1420,17 +1445,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:996 +#: ../../library/logging.rst:1012 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:998 +#: ../../library/logging.rst:1014 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1004 +#: ../../library/logging.rst:1020 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1439,14 +1464,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:1025 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1032 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1455,24 +1480,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1043 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1029 +#: ../../library/logging.rst:1045 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1050 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1039 +#: ../../library/logging.rst:1055 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1481,7 +1506,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1060 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1491,7 +1516,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1070 +#: ../../library/logging.rst:1086 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1500,18 +1525,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1081 +#: ../../library/logging.rst:1097 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1087 +#: ../../library/logging.rst:1103 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1091 +#: ../../library/logging.rst:1107 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1522,58 +1547,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1105 +#: ../../library/logging.rst:1121 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1114 +#: ../../library/logging.rst:1130 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1120 +#: ../../library/logging.rst:1136 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1123 +#: ../../library/logging.rst:1139 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1130 +#: ../../library/logging.rst:1146 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1152 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1142 +#: ../../library/logging.rst:1158 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1148 +#: ../../library/logging.rst:1164 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1153 +#: ../../library/logging.rst:1169 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1587,7 +1612,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1164 +#: ../../library/logging.rst:1180 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1595,13 +1620,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1169 +#: ../../library/logging.rst:1185 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1175 +#: ../../library/logging.rst:1191 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1611,17 +1636,17 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1182 +#: ../../library/logging.rst:1198 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1187 +#: ../../library/logging.rst:1203 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1189 +#: ../../library/logging.rst:1205 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1631,20 +1656,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1212 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1200 +#: ../../library/logging.rst:1216 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1203 +#: ../../library/logging.rst:1219 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1653,7 +1678,7 @@ msgid "" "versa." msgstr "" -#: ../../library/logging.rst:1209 +#: ../../library/logging.rst:1225 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1661,7 +1686,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1217 +#: ../../library/logging.rst:1233 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1669,7 +1694,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1225 +#: ../../library/logging.rst:1241 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1678,13 +1703,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1231 +#: ../../library/logging.rst:1247 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1234 +#: ../../library/logging.rst:1250 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1693,54 +1718,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1241 +#: ../../library/logging.rst:1257 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1248 +#: ../../library/logging.rst:1264 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1248 +#: ../../library/logging.rst:1264 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1252 +#: ../../library/logging.rst:1268 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1252 +#: ../../library/logging.rst:1268 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1256 +#: ../../library/logging.rst:1272 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1256 +#: ../../library/logging.rst:1272 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1261 +#: ../../library/logging.rst:1277 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1261 +#: ../../library/logging.rst:1277 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1264 +#: ../../library/logging.rst:1280 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1264 +#: ../../library/logging.rst:1280 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1275 +#: ../../library/logging.rst:1291 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1275 +#: ../../library/logging.rst:1291 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1297 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1297 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1780,33 +1805,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1290 +#: ../../library/logging.rst:1306 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1290 +#: ../../library/logging.rst:1306 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1296 +#: ../../library/logging.rst:1312 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1296 +#: ../../library/logging.rst:1312 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1301 +#: ../../library/logging.rst:1317 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1301 +#: ../../library/logging.rst:1317 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1815,39 +1840,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1312 +#: ../../library/logging.rst:1328 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1331 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1321 +#: ../../library/logging.rst:1337 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1324 +#: ../../library/logging.rst:1340 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1329 +#: ../../library/logging.rst:1345 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1349 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1340 +#: ../../library/logging.rst:1356 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`__init__` such that only a name " @@ -1859,32 +1884,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1351 +#: ../../library/logging.rst:1367 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1353 +#: ../../library/logging.rst:1369 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1355 +#: ../../library/logging.rst:1371 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1376 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1362 +#: ../../library/logging.rst:1378 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1364 +#: ../../library/logging.rst:1380 msgid "The logger name." msgstr "" @@ -1892,7 +1917,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1381 msgid "The logging level (numeric)." msgstr "" @@ -1900,7 +1925,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1366 +#: ../../library/logging.rst:1382 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1908,19 +1933,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1383 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1384 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1369 +#: ../../library/logging.rst:1385 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1370 +#: ../../library/logging.rst:1386 msgid "An exception tuple, or ``None``." msgstr "" @@ -1928,7 +1953,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1387 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1936,7 +1961,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1373 +#: ../../library/logging.rst:1389 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1946,15 +1971,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1391 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1379 +#: ../../library/logging.rst:1395 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1399 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -1965,22 +1990,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1410 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1396 +#: ../../library/logging.rst:1412 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1401 +#: ../../library/logging.rst:1417 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1404 +#: ../../library/logging.rst:1420 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -1989,46 +2014,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1409 +#: ../../library/logging.rst:1425 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1417 +#: ../../library/logging.rst:1433 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1417 +#: ../../library/logging.rst:1433 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1436 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1436 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1424 +#: ../../library/logging.rst:1440 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1423 +#: ../../library/logging.rst:1439 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1429 +#: ../../library/logging.rst:1445 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1427 +#: ../../library/logging.rst:1443 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/mailcap.po b/library/mailcap.po index bf56a2733a..dfb35a6551 100644 --- a/library/mailcap.po +++ b/library/mailcap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-09-21 00:21+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,7 +98,24 @@ msgid "" "the check fails." msgstr "" -#: ../../library/mailcap.rst:66 +#: ../../library/mailcap.rst:65 +msgid "" +"To prevent security issues with shell metacharacters (symbols that have " +"special effects in a shell command line), ``findmatch`` will refuse to " +"inject ASCII characters other than alphanumerics and ``@+=:,./-_`` into the " +"returned command line." +msgstr "" + +#: ../../library/mailcap.rst:70 +msgid "" +"If a disallowed character appears in *filename*, ``findmatch`` will always " +"return ``(None, None)`` as if no entry was found. If such a character " +"appears elsewhere (a value in *plist* or in *MIMEtype*), ``findmatch`` will " +"ignore all mailcap entries which use that value. A :mod:`warning ` " +"will be raised in either case." +msgstr "" + +#: ../../library/mailcap.rst:78 msgid "" "Returns a dictionary mapping MIME types to a list of mailcap file entries. " "This dictionary must be passed to the :func:`findmatch` function. An entry " @@ -106,7 +123,7 @@ msgid "" "the details of this representation." msgstr "" -#: ../../library/mailcap.rst:71 +#: ../../library/mailcap.rst:83 msgid "" "The information is derived from all of the mailcap files found on the " "system. Settings in the user's mailcap file :file:`$HOME/.mailcap` will " @@ -114,6 +131,6 @@ msgid "" "usr/etc/mailcap`, and :file:`/usr/local/etc/mailcap`." msgstr "" -#: ../../library/mailcap.rst:76 +#: ../../library/mailcap.rst:88 msgid "An example usage::" msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 2e3fc72503..0cb830b77c 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-14 00:20+0000\n" +"POT-Creation-Date: 2022-09-16 10:07+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1586,15 +1586,16 @@ msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." "execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, " -"``DELETE``, or ``REPLACE`` statements. Use the :meth:`~Connection.commit` " -"and :meth:`~Connection.rollback` methods to respectively commit and roll " -"back pending transactions. You can choose the underlying `SQLite transaction " +"``DELETE``, or ``REPLACE`` statements; for other statements, no implicit " +"transaction handling is performed. Use the :meth:`~Connection.commit` and :" +"meth:`~Connection.rollback` methods to respectively commit and roll back " +"pending transactions. You can choose the underlying `SQLite transaction " "behaviour`_ — that is, whether and what type of ``BEGIN`` statements :mod:`!" "sqlite3` implicitly executes – via the :attr:`~Connection.isolation_level` " "attribute." msgstr "" -#: ../../library/sqlite3.rst:1861 +#: ../../library/sqlite3.rst:1862 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -1604,14 +1605,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1869 +#: ../../library/sqlite3.rst:1870 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:1873 +#: ../../library/sqlite3.rst:1874 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." diff --git a/library/typing.po b/library/typing.po index d138b4a16b..b63c3a2337 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-14 00:16+0000\n" +"POT-Creation-Date: 2022-09-21 00:21+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,151 +60,158 @@ msgid "" "provides backports of these new features to older versions of Python." msgstr "" -#: ../../library/typing.rst:42 +#: ../../library/typing.rst:41 +msgid "" +"The documentation at https://typing.readthedocs.io/ serves as useful " +"reference for type system features, useful typing related tools and typing " +"best practices." +msgstr "" + +#: ../../library/typing.rst:47 msgid "Relevant PEPs" msgstr "" -#: ../../library/typing.rst:44 +#: ../../library/typing.rst:49 msgid "" "Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a " "number of PEPs have modified and enhanced Python's framework for type " "annotations. These include:" msgstr "" -#: ../../library/typing.rst:49 +#: ../../library/typing.rst:54 msgid ":pep:`526`: Syntax for Variable Annotations" msgstr "" -#: ../../library/typing.rst:49 +#: ../../library/typing.rst:54 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" msgstr "" -#: ../../library/typing.rst:52 +#: ../../library/typing.rst:57 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" -#: ../../library/typing.rst:52 +#: ../../library/typing.rst:57 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" -#: ../../library/typing.rst:55 +#: ../../library/typing.rst:60 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/typing.rst:55 +#: ../../library/typing.rst:60 msgid "" "*Introducing* :class:`types.GenericAlias` and the ability to use standard " "library classes as :ref:`generic types`" msgstr "" -#: ../../library/typing.rst:57 +#: ../../library/typing.rst:62 msgid ":pep:`586`: Literal Types" msgstr "" -#: ../../library/typing.rst:58 +#: ../../library/typing.rst:63 msgid "*Introducing* :data:`Literal`" msgstr "" -#: ../../library/typing.rst:59 +#: ../../library/typing.rst:64 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" msgstr "" -#: ../../library/typing.rst:60 +#: ../../library/typing.rst:65 msgid "*Introducing* :class:`TypedDict`" msgstr "" -#: ../../library/typing.rst:61 +#: ../../library/typing.rst:66 msgid ":pep:`591`: Adding a final qualifier to typing" msgstr "" -#: ../../library/typing.rst:62 +#: ../../library/typing.rst:67 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" msgstr "" -#: ../../library/typing.rst:63 +#: ../../library/typing.rst:68 msgid ":pep:`593`: Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:64 +#: ../../library/typing.rst:69 msgid "*Introducing* :data:`Annotated`" msgstr "" -#: ../../library/typing.rst:67 +#: ../../library/typing.rst:72 msgid ":pep:`604`: Allow writing union types as ``X | Y``" msgstr "" -#: ../../library/typing.rst:66 +#: ../../library/typing.rst:71 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" -#: ../../library/typing.rst:69 +#: ../../library/typing.rst:74 msgid ":pep:`612`: Parameter Specification Variables" msgstr "" -#: ../../library/typing.rst:70 +#: ../../library/typing.rst:75 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:71 +#: ../../library/typing.rst:76 msgid ":pep:`613`: Explicit Type Aliases" msgstr "" -#: ../../library/typing.rst:72 +#: ../../library/typing.rst:77 msgid "*Introducing* :data:`TypeAlias`" msgstr "" -#: ../../library/typing.rst:74 +#: ../../library/typing.rst:79 msgid ":pep:`647`: User-Defined Type Guards" msgstr "" -#: ../../library/typing.rst:74 +#: ../../library/typing.rst:79 msgid "*Introducing* :data:`TypeGuard`" msgstr "" -#: ../../library/typing.rst:79 +#: ../../library/typing.rst:84 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:81 +#: ../../library/typing.rst:86 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " "``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" msgstr "" -#: ../../library/typing.rst:92 +#: ../../library/typing.rst:97 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:110 +#: ../../library/typing.rst:115 msgid "" "Note that ``None`` as a type hint is a special case and is replaced by " "``type(None)``." msgstr "" -#: ../../library/typing.rst:116 +#: ../../library/typing.rst:121 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:118 +#: ../../library/typing.rst:123 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:125 +#: ../../library/typing.rst:130 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:137 +#: ../../library/typing.rst:142 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -212,7 +219,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:145 +#: ../../library/typing.rst:150 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -221,31 +228,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:151 +#: ../../library/typing.rst:156 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:154 +#: ../../library/typing.rst:159 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:163 +#: ../../library/typing.rst:168 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:171 +#: ../../library/typing.rst:176 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:173 +#: ../../library/typing.rst:178 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:177 +#: ../../library/typing.rst:182 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -253,7 +260,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:182 +#: ../../library/typing.rst:187 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -263,39 +270,39 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:191 +#: ../../library/typing.rst:196 msgid "" "``NewType`` is now a class rather than a function. There is some additional " "runtime cost when calling ``NewType`` over a regular function. However, " "this cost will be reduced in 3.11.0." msgstr "" -#: ../../library/typing.rst:198 +#: ../../library/typing.rst:203 msgid "Callable" msgstr "" -#: ../../library/typing.rst:200 +#: ../../library/typing.rst:205 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:203 ../../library/typing.rst:1018 -#: ../../library/typing.rst:2252 +#: ../../library/typing.rst:208 ../../library/typing.rst:1023 +#: ../../library/typing.rst:2257 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:218 +#: ../../library/typing.rst:223 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:222 ../../library/typing.rst:709 +#: ../../library/typing.rst:227 ../../library/typing.rst:714 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -306,97 +313,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:230 ../../library/typing.rst:721 +#: ../../library/typing.rst:235 ../../library/typing.rst:726 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more information." msgstr "" -#: ../../library/typing.rst:235 +#: ../../library/typing.rst:240 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:241 +#: ../../library/typing.rst:246 msgid "Generics" msgstr "" -#: ../../library/typing.rst:243 +#: ../../library/typing.rst:248 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, abstract base classes have been extended to " "support subscription to denote expected types for container elements." msgstr "" -#: ../../library/typing.rst:254 +#: ../../library/typing.rst:259 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:270 +#: ../../library/typing.rst:275 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:272 +#: ../../library/typing.rst:277 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:298 +#: ../../library/typing.rst:303 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:302 +#: ../../library/typing.rst:307 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[t]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:311 +#: ../../library/typing.rst:316 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:323 +#: ../../library/typing.rst:328 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:334 +#: ../../library/typing.rst:339 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:344 +#: ../../library/typing.rst:349 msgid "" "When inheriting from generic classes, some type variables could be fixed::" msgstr "" -#: ../../library/typing.rst:354 +#: ../../library/typing.rst:359 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:356 +#: ../../library/typing.rst:361 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``::" msgstr "" -#: ../../library/typing.rst:364 +#: ../../library/typing.rst:369 msgid "User defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:381 +#: ../../library/typing.rst:386 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:384 +#: ../../library/typing.rst:389 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -406,7 +413,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:401 +#: ../../library/typing.rst:406 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -414,20 +421,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:413 +#: ../../library/typing.rst:418 msgid "" "Do note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:417 +#: ../../library/typing.rst:422 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:421 +#: ../../library/typing.rst:426 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -435,24 +442,24 @@ msgid "" "hashable and comparable for equality." msgstr "" -#: ../../library/typing.rst:428 +#: ../../library/typing.rst:433 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:430 +#: ../../library/typing.rst:435 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:434 +#: ../../library/typing.rst:439 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:452 +#: ../../library/typing.rst:457 msgid "" "Notice that no typechecking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -461,19 +468,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:458 +#: ../../library/typing.rst:463 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:471 +#: ../../library/typing.rst:476 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:474 +#: ../../library/typing.rst:479 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -481,7 +488,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:479 +#: ../../library/typing.rst:484 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -489,24 +496,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:501 +#: ../../library/typing.rst:506 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:506 +#: ../../library/typing.rst:511 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:508 +#: ../../library/typing.rst:513 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:512 +#: ../../library/typing.rst:517 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -515,7 +522,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:525 +#: ../../library/typing.rst:530 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -524,22 +531,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:541 +#: ../../library/typing.rst:546 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:546 +#: ../../library/typing.rst:551 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:548 +#: ../../library/typing.rst:553 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:552 +#: ../../library/typing.rst:557 msgid "" "This module defines several types that are subclasses of pre-existing " "standard library classes which also extend :class:`Generic` to support type " @@ -547,7 +554,7 @@ msgid "" "corresponding pre-existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:558 +#: ../../library/typing.rst:563 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings will be issued by the interpreter. It is expected that type " @@ -555,147 +562,147 @@ msgid "" "Python 3.9 or newer." msgstr "" -#: ../../library/typing.rst:563 +#: ../../library/typing.rst:568 msgid "" "The deprecated types will be removed from the :mod:`typing` module in the " "first Python version released 5 years after the release of Python 3.9.0. See " "details in :pep:`585`—*Type Hinting Generics In Standard Collections*." msgstr "" -#: ../../library/typing.rst:569 +#: ../../library/typing.rst:574 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:572 +#: ../../library/typing.rst:577 msgid "Special types" msgstr "" -#: ../../library/typing.rst:574 +#: ../../library/typing.rst:579 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:578 +#: ../../library/typing.rst:583 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:580 +#: ../../library/typing.rst:585 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:581 +#: ../../library/typing.rst:586 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:585 +#: ../../library/typing.rst:590 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:603 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:605 +#: ../../library/typing.rst:610 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:610 +#: ../../library/typing.rst:615 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:612 +#: ../../library/typing.rst:617 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:616 +#: ../../library/typing.rst:621 msgid "" "Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " "first item of type X and the second of type Y. The type of the empty tuple " "can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:620 +#: ../../library/typing.rst:625 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:624 +#: ../../library/typing.rst:629 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " "``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:633 msgid "" ":class:`builtins.tuple ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:634 +#: ../../library/typing.rst:639 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:636 +#: ../../library/typing.rst:641 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:638 +#: ../../library/typing.rst:643 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:640 +#: ../../library/typing.rst:645 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:644 +#: ../../library/typing.rst:649 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:648 +#: ../../library/typing.rst:653 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:652 +#: ../../library/typing.rst:657 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:656 +#: ../../library/typing.rst:661 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:658 +#: ../../library/typing.rst:663 msgid "You cannot write ``Union[X][Y]``." msgstr "" -#: ../../library/typing.rst:660 +#: ../../library/typing.rst:665 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:663 +#: ../../library/typing.rst:668 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:669 +#: ../../library/typing.rst:674 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:676 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:673 +#: ../../library/typing.rst:678 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -703,31 +710,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:681 +#: ../../library/typing.rst:686 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:688 +#: ../../library/typing.rst:693 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:694 +#: ../../library/typing.rst:699 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:696 +#: ../../library/typing.rst:701 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " "types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:701 +#: ../../library/typing.rst:706 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -737,19 +744,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:717 +#: ../../library/typing.rst:722 msgid "" ":class:`collections.abc.Callable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:731 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:731 +#: ../../library/typing.rst:736 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -759,7 +766,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec`." msgstr "" -#: ../../library/typing.rst:738 +#: ../../library/typing.rst:743 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -770,17 +777,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:777 ../../library/typing.rst:1264 +#: ../../library/typing.rst:782 ../../library/typing.rst:1269 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:779 +#: ../../library/typing.rst:784 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:784 +#: ../../library/typing.rst:789 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``Type[C]`` may accept values that are " @@ -788,11 +795,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:793 +#: ../../library/typing.rst:798 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:805 +#: ../../library/typing.rst:810 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -802,39 +809,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:813 +#: ../../library/typing.rst:818 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:819 +#: ../../library/typing.rst:824 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:824 +#: ../../library/typing.rst:829 msgid "" ":class:`builtins.type ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:830 +#: ../../library/typing.rst:835 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:844 +#: ../../library/typing.rst:849 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:850 +#: ../../library/typing.rst:855 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -842,22 +849,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:863 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:860 +#: ../../library/typing.rst:865 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:868 +#: ../../library/typing.rst:873 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:870 +#: ../../library/typing.rst:875 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -865,19 +872,19 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:884 +#: ../../library/typing.rst:889 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:896 ../../library/typing.rst:2147 +#: ../../library/typing.rst:901 ../../library/typing.rst:2152 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:903 +#: ../../library/typing.rst:908 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -894,7 +901,7 @@ msgid "" "application." msgstr "" -#: ../../library/typing.rst:917 +#: ../../library/typing.rst:922 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -903,21 +910,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:923 +#: ../../library/typing.rst:928 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:932 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:931 +#: ../../library/typing.rst:936 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " @@ -925,59 +932,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:940 +#: ../../library/typing.rst:945 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:943 +#: ../../library/typing.rst:948 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:945 +#: ../../library/typing.rst:950 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:947 +#: ../../library/typing.rst:952 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:952 +#: ../../library/typing.rst:957 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:955 +#: ../../library/typing.rst:960 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:962 +#: ../../library/typing.rst:967 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:974 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:975 +#: ../../library/typing.rst:980 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:988 +#: ../../library/typing.rst:993 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:992 +#: ../../library/typing.rst:997 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -986,44 +993,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1007 +#: ../../library/typing.rst:1012 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1011 +#: ../../library/typing.rst:1016 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1014 +#: ../../library/typing.rst:1019 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1015 +#: ../../library/typing.rst:1020 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1032 +#: ../../library/typing.rst:1037 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1036 +#: ../../library/typing.rst:1041 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1042 +#: ../../library/typing.rst:1047 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``List[object]`` " @@ -1032,50 +1039,50 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1048 +#: ../../library/typing.rst:1053 msgid "" "``TypeGuard`` also works with type variables. For more information, see :" "pep:`647` (User-Defined Type Guards)." msgstr "" -#: ../../library/typing.rst:1055 +#: ../../library/typing.rst:1060 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1057 +#: ../../library/typing.rst:1062 msgid "" "These are not used in annotations. They are building blocks for creating " "generic types." msgstr "" -#: ../../library/typing.rst:1061 +#: ../../library/typing.rst:1066 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1063 +#: ../../library/typing.rst:1068 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1072 +#: ../../library/typing.rst:1077 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1085 +#: ../../library/typing.rst:1090 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1087 ../../library/typing.rst:1193 -#: ../../library/typing.rst:1370 +#: ../../library/typing.rst:1092 ../../library/typing.rst:1198 +#: ../../library/typing.rst:1375 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1093 +#: ../../library/typing.rst:1098 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1083,13 +1090,13 @@ msgid "" "types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1113 +#: ../../library/typing.rst:1118 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1116 +#: ../../library/typing.rst:1121 msgid "" "Constrained type variables and bound type variables have different semantics " "in several important ways. Using a *constrained* type variable means that " @@ -1097,19 +1104,19 @@ msgid "" "constraints given::" msgstr "" -#: ../../library/typing.rst:1126 +#: ../../library/typing.rst:1131 msgid "" "Using a *bound* type variable, however, means that the ``TypeVar`` will be " "solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1137 +#: ../../library/typing.rst:1142 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1143 +#: ../../library/typing.rst:1148 msgid "" "Bound type variables are particularly useful for annotating :func:" "`classmethods ` that serve as alternative constructors. In the " @@ -1121,26 +1128,26 @@ msgid "" "type even if the method is called on a subclass::" msgstr "" -#: ../../library/typing.rst:1181 +#: ../../library/typing.rst:1186 msgid "" "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" "func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:1184 +#: ../../library/typing.rst:1189 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1190 +#: ../../library/typing.rst:1195 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1197 +#: ../../library/typing.rst:1202 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1150,7 +1157,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1204 +#: ../../library/typing.rst:1209 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1158,27 +1165,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1228 +#: ../../library/typing.rst:1233 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1232 +#: ../../library/typing.rst:1237 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1234 +#: ../../library/typing.rst:1239 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1241 +#: ../../library/typing.rst:1246 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1191,7 +1198,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1251 +#: ../../library/typing.rst:1256 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1200,17 +1207,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1260 +#: ../../library/typing.rst:1265 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1266 +#: ../../library/typing.rst:1271 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1271 +#: ../../library/typing.rst:1276 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1218,36 +1225,36 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1276 +#: ../../library/typing.rst:1281 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1288 +#: ../../library/typing.rst:1293 msgid "" "``AnyStr`` is a :class:`constrained type variable ` defined as " "``AnyStr = TypeVar('AnyStr', str, bytes)``." msgstr "" -#: ../../library/typing.rst:1291 +#: ../../library/typing.rst:1296 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1308 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1309 +#: ../../library/typing.rst:1314 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1321 +#: ../../library/typing.rst:1326 msgid "" "See :pep:`544` for details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1255,15 +1262,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1326 +#: ../../library/typing.rst:1331 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1336 +#: ../../library/typing.rst:1341 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1338 +#: ../../library/typing.rst:1343 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1272,7 +1279,7 @@ msgid "" "For example::" msgstr "" -#: ../../library/typing.rst:1351 +#: ../../library/typing.rst:1356 msgid "" ":func:`runtime_checkable` will check only the presence of the required " "methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " @@ -1282,38 +1289,38 @@ msgid "" "making it impossible to call (instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1362 +#: ../../library/typing.rst:1367 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1364 +#: ../../library/typing.rst:1369 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1368 +#: ../../library/typing.rst:1373 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1376 +#: ../../library/typing.rst:1381 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1380 +#: ../../library/typing.rst:1385 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1389 +#: ../../library/typing.rst:1394 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1391 +#: ../../library/typing.rst:1396 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1322,52 +1329,52 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1397 +#: ../../library/typing.rst:1402 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1407 +#: ../../library/typing.rst:1412 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1411 +#: ../../library/typing.rst:1416 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1414 +#: ../../library/typing.rst:1419 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1417 +#: ../../library/typing.rst:1422 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1421 +#: ../../library/typing.rst:1426 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1427 +#: ../../library/typing.rst:1432 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1437 +#: ../../library/typing.rst:1442 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1442 +#: ../../library/typing.rst:1447 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1445 +#: ../../library/typing.rst:1450 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1375,27 +1382,27 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1461 +#: ../../library/typing.rst:1466 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms::" msgstr "" -#: ../../library/typing.rst:1468 +#: ../../library/typing.rst:1473 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1480 +#: ../../library/typing.rst:1485 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "override this by specifying totality. Usage::" msgstr "" -#: ../../library/typing.rst:1488 +#: ../../library/typing.rst:1493 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1403,37 +1410,37 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1493 +#: ../../library/typing.rst:1498 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1500 +#: ../../library/typing.rst:1505 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1508 +#: ../../library/typing.rst:1513 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, notably " "including :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1526 +#: ../../library/typing.rst:1531 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1532 +#: ../../library/typing.rst:1537 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1552 +#: ../../library/typing.rst:1557 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " @@ -1443,152 +1450,152 @@ msgid "" "it from another ``TypedDict`` with a different value for ``total``. Usage::" msgstr "" -#: ../../library/typing.rst:1574 +#: ../../library/typing.rst:1579 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1579 +#: ../../library/typing.rst:1584 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1582 +#: ../../library/typing.rst:1587 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1586 +#: ../../library/typing.rst:1591 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1590 +#: ../../library/typing.rst:1595 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1595 +#: ../../library/typing.rst:1600 msgid "" ":class:`builtins.dict ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1606 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1606 +#: ../../library/typing.rst:1611 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1616 +#: ../../library/typing.rst:1621 msgid "" ":class:`builtins.list ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1622 +#: ../../library/typing.rst:1627 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1626 +#: ../../library/typing.rst:1631 msgid "" ":class:`builtins.set ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1632 +#: ../../library/typing.rst:1637 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1634 +#: ../../library/typing.rst:1639 msgid "" ":class:`builtins.frozenset ` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1638 +#: ../../library/typing.rst:1643 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1646 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1645 +#: ../../library/typing.rst:1650 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1649 +#: ../../library/typing.rst:1654 msgid "" ":class:`collections.defaultdict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1655 +#: ../../library/typing.rst:1660 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1659 +#: ../../library/typing.rst:1664 msgid "" ":class:`collections.OrderedDict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1670 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1670 +#: ../../library/typing.rst:1675 msgid "" ":class:`collections.ChainMap` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1676 +#: ../../library/typing.rst:1681 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:1681 +#: ../../library/typing.rst:1686 msgid "" ":class:`collections.Counter` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1687 +#: ../../library/typing.rst:1692 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:1692 +#: ../../library/typing.rst:1697 msgid "" ":class:`collections.deque` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1697 +#: ../../library/typing.rst:1702 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:1703 +#: ../../library/typing.rst:1708 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:1710 +#: ../../library/typing.rst:1715 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1715 +#: ../../library/typing.rst:1720 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1596,413 +1603,413 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:1725 +#: ../../library/typing.rst:1730 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1726 +#: ../../library/typing.rst:1731 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1737 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:1736 +#: ../../library/typing.rst:1741 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1750 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1753 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1752 +#: ../../library/typing.rst:1757 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:1754 +#: ../../library/typing.rst:1759 msgid "" ":class:`collections.abc.Set` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1760 +#: ../../library/typing.rst:1765 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1767 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:1765 +#: ../../library/typing.rst:1770 msgid "" "As a shorthand for this type, :class:`bytes` can be used to annotate " "arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:1768 +#: ../../library/typing.rst:1773 msgid "" ":class:`collections.abc.ByteString` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1774 +#: ../../library/typing.rst:1779 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:1778 +#: ../../library/typing.rst:1783 msgid "" ":class:`collections.abc.Collection` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:1789 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:1786 +#: ../../library/typing.rst:1791 msgid "" ":class:`collections.abc.Container` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1792 +#: ../../library/typing.rst:1797 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:1794 +#: ../../library/typing.rst:1799 msgid "" ":class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1800 +#: ../../library/typing.rst:1805 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:1802 +#: ../../library/typing.rst:1807 msgid "" ":class:`collections.abc.KeysView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1808 +#: ../../library/typing.rst:1813 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:1814 +#: ../../library/typing.rst:1819 msgid "" ":class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1820 +#: ../../library/typing.rst:1825 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:1822 +#: ../../library/typing.rst:1827 msgid "" ":class:`collections.abc.MappingView` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1828 +#: ../../library/typing.rst:1833 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:1830 +#: ../../library/typing.rst:1835 msgid "" ":class:`collections.abc.MutableMapping` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1836 +#: ../../library/typing.rst:1841 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:1838 +#: ../../library/typing.rst:1843 msgid "" ":class:`collections.abc.MutableSequence` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1844 +#: ../../library/typing.rst:1849 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:1846 +#: ../../library/typing.rst:1851 msgid "" ":class:`collections.abc.MutableSet` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:1857 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:1854 +#: ../../library/typing.rst:1859 msgid "" ":class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:1865 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:1862 +#: ../../library/typing.rst:1867 msgid "" ":class:`collections.abc.ValuesView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1867 +#: ../../library/typing.rst:1872 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1876 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:1873 +#: ../../library/typing.rst:1878 msgid "" ":class:`collections.abc.Iterable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1879 +#: ../../library/typing.rst:1884 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:1881 +#: ../../library/typing.rst:1886 msgid "" ":class:`collections.abc.Iterator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1887 +#: ../../library/typing.rst:1892 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:1896 +#: ../../library/typing.rst:1901 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:1900 +#: ../../library/typing.rst:1905 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:1913 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1916 +#: ../../library/typing.rst:1921 msgid "" ":class:`collections.abc.Generator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1922 +#: ../../library/typing.rst:1927 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:1926 +#: ../../library/typing.rst:1931 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:1933 msgid "" ":class:`collections.abc.Reversible` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1934 +#: ../../library/typing.rst:1939 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:1937 +#: ../../library/typing.rst:1942 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:1941 +#: ../../library/typing.rst:1946 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1958 msgid "" ":class:`collections.abc.Coroutine` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1959 +#: ../../library/typing.rst:1964 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:1968 +#: ../../library/typing.rst:1973 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:1972 +#: ../../library/typing.rst:1977 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1980 +#: ../../library/typing.rst:1985 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1990 +#: ../../library/typing.rst:1995 msgid "" ":class:`collections.abc.AsyncGenerator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2001 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2000 +#: ../../library/typing.rst:2005 msgid "" ":class:`collections.abc.AsyncIterable` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2006 +#: ../../library/typing.rst:2011 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2010 +#: ../../library/typing.rst:2015 msgid "" ":class:`collections.abc.AsyncIterator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2016 +#: ../../library/typing.rst:2021 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2020 +#: ../../library/typing.rst:2025 msgid "" ":class:`collections.abc.Awaitable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2031 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2035 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2035 +#: ../../library/typing.rst:2040 msgid "" ":class:`contextlib.AbstractContextManager` now supports ``[]``. See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2046 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2046 +#: ../../library/typing.rst:2051 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2051 +#: ../../library/typing.rst:2056 msgid "Protocols" msgstr "" -#: ../../library/typing.rst:2053 +#: ../../library/typing.rst:2058 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2057 +#: ../../library/typing.rst:2062 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2062 +#: ../../library/typing.rst:2067 msgid "An ABC with one abstract method ``__bytes__``." msgstr "" -#: ../../library/typing.rst:2066 +#: ../../library/typing.rst:2071 msgid "An ABC with one abstract method ``__complex__``." msgstr "" -#: ../../library/typing.rst:2070 +#: ../../library/typing.rst:2075 msgid "An ABC with one abstract method ``__float__``." msgstr "" -#: ../../library/typing.rst:2074 +#: ../../library/typing.rst:2079 msgid "An ABC with one abstract method ``__index__``." msgstr "" -#: ../../library/typing.rst:2080 +#: ../../library/typing.rst:2085 msgid "An ABC with one abstract method ``__int__``." msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2089 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2093 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2092 +#: ../../library/typing.rst:2097 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2094 +#: ../../library/typing.rst:2099 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2101 +#: ../../library/typing.rst:2106 msgid "" "The ``@overload`` decorator allows describing functions and methods that " "support multiple different combinations of argument types. A series of " @@ -2017,69 +2024,69 @@ msgid "" "variable::" msgstr "" -#: ../../library/typing.rst:2125 +#: ../../library/typing.rst:2130 msgid "See :pep:`484` for details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:2129 +#: ../../library/typing.rst:2134 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2154 +#: ../../library/typing.rst:2159 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2161 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods defined in that class (but not to methods defined " "in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2165 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2164 +#: ../../library/typing.rst:2169 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2171 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2171 +#: ../../library/typing.rst:2176 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2178 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2184 +#: ../../library/typing.rst:2189 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2188 +#: ../../library/typing.rst:2193 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2192 +#: ../../library/typing.rst:2197 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2195 +#: ../../library/typing.rst:2200 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2089,29 +2096,29 @@ msgid "" "merging all the ``__annotations__`` along ``C.__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2203 +#: ../../library/typing.rst:2208 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2223 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2223 +#: ../../library/typing.rst:2228 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2229 +#: ../../library/typing.rst:2234 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2231 +#: ../../library/typing.rst:2236 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2122,11 +2129,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2250 +#: ../../library/typing.rst:2255 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2265 +#: ../../library/typing.rst:2270 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2134,24 +2141,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2276 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2278 +#: ../../library/typing.rst:2283 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2282 +#: ../../library/typing.rst:2287 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2291 +#: ../../library/typing.rst:2296 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2159,7 +2166,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2298 +#: ../../library/typing.rst:2303 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " diff --git a/library/wave.po b/library/wave.po index 1ddcc5c33a..40ff44399a 100644 --- a/library/wave.po +++ b/library/wave.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2022-09-24 00:21+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,41 +29,42 @@ msgstr "**原始碼:**\\ :source:`Lib/wave.py`" #: ../../library/wave.rst:14 msgid "" "The :mod:`wave` module provides a convenient interface to the WAV sound " -"format. It does not support compression/decompression, but it does support " -"mono/stereo." +"format. Only files using ``WAVE_FORMAT_PCM`` are supported. Note that this " +"does not include files using ``WAVE_FORMAT_EXTENSIBLE`` even if the " +"subformat is PCM." msgstr "" -#: ../../library/wave.rst:17 +#: ../../library/wave.rst:18 msgid "The :mod:`wave` module defines the following function and exception:" msgstr "" -#: ../../library/wave.rst:22 +#: ../../library/wave.rst:23 msgid "" "If *file* is a string, open the file by that name, otherwise treat it as a " "file-like object. *mode* can be:" msgstr "" -#: ../../library/wave.rst:26 +#: ../../library/wave.rst:27 msgid "``'rb'``" msgstr "``'rb'``" -#: ../../library/wave.rst:26 +#: ../../library/wave.rst:27 msgid "Read only mode." msgstr "" -#: ../../library/wave.rst:29 +#: ../../library/wave.rst:30 msgid "``'wb'``" msgstr "``'wb'``" -#: ../../library/wave.rst:29 +#: ../../library/wave.rst:30 msgid "Write only mode." msgstr "" -#: ../../library/wave.rst:31 +#: ../../library/wave.rst:32 msgid "Note that it does not allow read/write WAV files." msgstr "" -#: ../../library/wave.rst:33 +#: ../../library/wave.rst:34 msgid "" "A *mode* of ``'rb'`` returns a :class:`Wave_read` object, while a *mode* of " "``'wb'`` returns a :class:`Wave_write` object. If *mode* is omitted and a " @@ -71,14 +72,14 @@ msgid "" "value for *mode*." msgstr "" -#: ../../library/wave.rst:38 +#: ../../library/wave.rst:39 msgid "" "If you pass in a file-like object, the wave object will not close it when " "its :meth:`close` method is called; it is the caller's responsibility to " "close the file object." msgstr "" -#: ../../library/wave.rst:42 +#: ../../library/wave.rst:43 msgid "" "The :func:`.open` function may be used in a :keyword:`with` statement. When " "the :keyword:`!with` block completes, the :meth:`Wave_read.close() \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1069,40 +1069,52 @@ msgstr "" msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " -"additional keyword arguments. If a keyword is already present (as an " -"explicit keyword argument, or from another unpacking), a :exc:`TypeError` " -"exception is raised." +"additional keyword arguments. If a parameter matching a key has already been " +"given a value (by an explicit keyword argument, or from another unpacking), " +"a :exc:`TypeError` exception is raised." msgstr "" #: ../../reference/expressions.rst:1056 msgid "" +"When ``**expression`` is used, each key in this mapping must be a string. " +"Each value from the mapping is assigned to the first formal parameter " +"eligible for keyword assignment whose name is equal to the key. A key need " +"not be a Python identifier (e.g. ``\"max-temp °F\"`` is acceptable, although " +"it will not match any formal parameter that could be declared). If there is " +"no match to a formal parameter the key-value pair is collected by the ``**`` " +"parameter, if there is one, or if there is not, a :exc:`TypeError` exception " +"is raised." +msgstr "" + +#: ../../reference/expressions.rst:1066 +msgid "" "Formal parameters using the syntax ``*identifier`` or ``**identifier`` " "cannot be used as positional argument slots or as keyword argument names." msgstr "" -#: ../../reference/expressions.rst:1059 +#: ../../reference/expressions.rst:1069 msgid "" "Function calls accept any number of ``*`` and ``**`` unpackings, positional " "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1065 +#: ../../reference/expressions.rst:1075 msgid "" "A call always returns some value, possibly ``None``, unless it raises an " "exception. How this value is computed depends on the type of the callable " "object." msgstr "" -#: ../../reference/expressions.rst:1069 +#: ../../reference/expressions.rst:1079 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1082 +#: ../../reference/expressions.rst:1092 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1078 +#: ../../reference/expressions.rst:1088 msgid "" "The code block for the function is executed, passing it the argument list. " "The first thing the code block will do is bind the formal parameters to the " @@ -1111,73 +1123,73 @@ msgid "" "value of the function call." msgstr "" -#: ../../reference/expressions.rst:1096 +#: ../../reference/expressions.rst:1106 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1095 +#: ../../reference/expressions.rst:1105 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1103 +#: ../../reference/expressions.rst:1113 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1103 +#: ../../reference/expressions.rst:1113 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1113 +#: ../../reference/expressions.rst:1123 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1111 +#: ../../reference/expressions.rst:1121 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1122 +#: ../../reference/expressions.rst:1132 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1120 +#: ../../reference/expressions.rst:1130 msgid "" "The class must define a :meth:`__call__` method; the effect is then the same " "as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1128 ../../reference/expressions.rst:1894 +#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1904 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1130 +#: ../../reference/expressions.rst:1140 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1142 +#: ../../reference/expressions.rst:1152 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1148 +#: ../../reference/expressions.rst:1158 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1154 +#: ../../reference/expressions.rst:1164 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1158 +#: ../../reference/expressions.rst:1168 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1185,7 +1197,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1163 +#: ../../reference/expressions.rst:1173 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1193,40 +1205,40 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1168 +#: ../../reference/expressions.rst:1178 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1172 +#: ../../reference/expressions.rst:1182 msgid "" "This operation can be customized using the special :meth:`__pow__` method." msgstr "" -#: ../../reference/expressions.rst:1177 +#: ../../reference/expressions.rst:1187 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1183 +#: ../../reference/expressions.rst:1193 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1194 +#: ../../reference/expressions.rst:1204 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " "argument; the operation can be overridden with the :meth:`__neg__` special " "method." msgstr "" -#: ../../reference/expressions.rst:1202 +#: ../../reference/expressions.rst:1212 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " "operation can be overridden with the :meth:`__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1209 +#: ../../reference/expressions.rst:1219 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " @@ -1234,17 +1246,17 @@ msgid "" "meth:`__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1218 +#: ../../reference/expressions.rst:1228 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1225 +#: ../../reference/expressions.rst:1235 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1229 +#: ../../reference/expressions.rst:1239 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1252,7 +1264,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1244 +#: ../../reference/expressions.rst:1254 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1262,19 +1274,19 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1250 +#: ../../reference/expressions.rst:1260 msgid "" "This operation can be customized using the special :meth:`__mul__` and :meth:" "`__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1257 +#: ../../reference/expressions.rst:1267 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1268 +#: ../../reference/expressions.rst:1278 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1284,13 +1296,13 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1275 +#: ../../reference/expressions.rst:1285 msgid "" "This operation can be customized using the special :meth:`__truediv__` and :" "meth:`__floordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1282 +#: ../../reference/expressions.rst:1292 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1302,7 +1314,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1291 +#: ../../reference/expressions.rst:1301 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1310,7 +1322,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1306 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1319,20 +1331,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1301 +#: ../../reference/expressions.rst:1311 msgid "" "The *modulo* operation can be customized using the special :meth:`__mod__` " "method." msgstr "" -#: ../../reference/expressions.rst:1303 +#: ../../reference/expressions.rst:1313 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1312 +#: ../../reference/expressions.rst:1322 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1340,84 +1352,84 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1317 +#: ../../reference/expressions.rst:1327 msgid "" "This operation can be customized using the special :meth:`__add__` and :meth:" "`__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1325 +#: ../../reference/expressions.rst:1335 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1328 +#: ../../reference/expressions.rst:1338 msgid "" "This operation can be customized using the special :meth:`__sub__` method." msgstr "" -#: ../../reference/expressions.rst:1334 +#: ../../reference/expressions.rst:1344 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1341 +#: ../../reference/expressions.rst:1351 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1346 +#: ../../reference/expressions.rst:1356 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1349 +#: ../../reference/expressions.rst:1359 msgid "" "This operation can be customized using the special :meth:`__lshift__` and :" "meth:`__rshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1364 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1361 +#: ../../reference/expressions.rst:1371 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1365 +#: ../../reference/expressions.rst:1375 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1376 +#: ../../reference/expressions.rst:1386 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " "integers or one of them must be a custom object overriding :meth:`__and__` " "or :meth:`__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1385 +#: ../../reference/expressions.rst:1395 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " "which must be integers or one of them must be a custom object overriding :" "meth:`__xor__` or :meth:`__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1394 +#: ../../reference/expressions.rst:1404 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " "must be integers or one of them must be a custom object overriding :meth:" "`__or__` or :meth:`__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1402 +#: ../../reference/expressions.rst:1412 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1414 +#: ../../reference/expressions.rst:1424 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1425,14 +1437,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1424 +#: ../../reference/expressions.rst:1434 msgid "" "Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " "comparison methods` may return non-boolean values. In this case Python will " "call :func:`bool` on such value in boolean contexts." msgstr "" -#: ../../reference/expressions.rst:1430 +#: ../../reference/expressions.rst:1440 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1440,7 +1452,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1434 +#: ../../reference/expressions.rst:1444 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1448,24 +1460,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1439 +#: ../../reference/expressions.rst:1449 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1444 +#: ../../reference/expressions.rst:1454 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1446 +#: ../../reference/expressions.rst:1456 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1449 +#: ../../reference/expressions.rst:1459 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1477,7 +1489,7 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1458 +#: ../../reference/expressions.rst:1468 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " @@ -1485,7 +1497,7 @@ msgid "" "methods` like :meth:`__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1464 +#: ../../reference/expressions.rst:1474 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1495,14 +1507,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1471 +#: ../../reference/expressions.rst:1481 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1475 +#: ../../reference/expressions.rst:1485 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1511,13 +1523,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1481 +#: ../../reference/expressions.rst:1491 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1484 +#: ../../reference/expressions.rst:1494 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1527,7 +1539,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1491 +#: ../../reference/expressions.rst:1501 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1537,32 +1549,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1498 +#: ../../reference/expressions.rst:1508 msgid "" "``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1502 +#: ../../reference/expressions.rst:1512 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1506 +#: ../../reference/expressions.rst:1516 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1510 +#: ../../reference/expressions.rst:1520 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1512 +#: ../../reference/expressions.rst:1522 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1571,7 +1583,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1518 +#: ../../reference/expressions.rst:1528 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1579,19 +1591,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1523 +#: ../../reference/expressions.rst:1533 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1525 +#: ../../reference/expressions.rst:1535 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1530 +#: ../../reference/expressions.rst:1540 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1600,25 +1612,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1536 +#: ../../reference/expressions.rst:1546 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal `(key, value)` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1540 +#: ../../reference/expressions.rst:1550 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1552 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1545 +#: ../../reference/expressions.rst:1555 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1629,110 +1641,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1553 +#: ../../reference/expressions.rst:1563 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1555 +#: ../../reference/expressions.rst:1565 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1558 +#: ../../reference/expressions.rst:1568 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1561 +#: ../../reference/expressions.rst:1571 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1564 +#: ../../reference/expressions.rst:1574 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1576 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1569 +#: ../../reference/expressions.rst:1579 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1571 +#: ../../reference/expressions.rst:1581 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1573 +#: ../../reference/expressions.rst:1583 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1575 +#: ../../reference/expressions.rst:1585 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1577 +#: ../../reference/expressions.rst:1587 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1580 +#: ../../reference/expressions.rst:1590 msgid "``x > y and y > z`` implies ``x > z``" msgstr "" -#: ../../reference/expressions.rst:1582 +#: ../../reference/expressions.rst:1592 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "" -#: ../../reference/expressions.rst:1584 +#: ../../reference/expressions.rst:1594 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1587 +#: ../../reference/expressions.rst:1597 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1589 +#: ../../reference/expressions.rst:1599 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1591 +#: ../../reference/expressions.rst:1601 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1593 +#: ../../reference/expressions.rst:1603 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1597 +#: ../../reference/expressions.rst:1607 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1601 +#: ../../reference/expressions.rst:1611 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1610 +#: ../../reference/expressions.rst:1620 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1612 +#: ../../reference/expressions.rst:1622 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -1743,7 +1755,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1620 +#: ../../reference/expressions.rst:1630 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -1751,14 +1763,14 @@ msgid "" "\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1625 +#: ../../reference/expressions.rst:1635 msgid "" "For user-defined classes which define the :meth:`__contains__` method, ``x " "in y`` returns ``True`` if ``y.__contains__(x)`` returns a true value, and " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1629 +#: ../../reference/expressions.rst:1639 msgid "" "For user-defined classes which do not define :meth:`__contains__` but do " "define :meth:`__iter__`, ``x in y`` is ``True`` if some value ``z``, for " @@ -1767,7 +1779,7 @@ msgid "" "as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1635 +#: ../../reference/expressions.rst:1645 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative " @@ -1776,17 +1788,17 @@ msgid "" "raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1647 +#: ../../reference/expressions.rst:1657 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1660 +#: ../../reference/expressions.rst:1670 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1662 +#: ../../reference/expressions.rst:1672 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -1794,11 +1806,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1674 +#: ../../reference/expressions.rst:1684 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1685 +#: ../../reference/expressions.rst:1695 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1809,25 +1821,25 @@ msgid "" "method." msgstr "" -#: ../../reference/expressions.rst:1694 +#: ../../reference/expressions.rst:1704 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1699 +#: ../../reference/expressions.rst:1709 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1704 +#: ../../reference/expressions.rst:1714 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1707 +#: ../../reference/expressions.rst:1717 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -1838,11 +1850,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1717 +#: ../../reference/expressions.rst:1727 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1722 +#: ../../reference/expressions.rst:1732 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -1850,44 +1862,44 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1727 +#: ../../reference/expressions.rst:1737 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1734 +#: ../../reference/expressions.rst:1744 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1741 +#: ../../reference/expressions.rst:1751 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1748 +#: ../../reference/expressions.rst:1758 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1760 +#: ../../reference/expressions.rst:1770 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1763 +#: ../../reference/expressions.rst:1773 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1767 +#: ../../reference/expressions.rst:1777 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1774 +#: ../../reference/expressions.rst:1784 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1785 +#: ../../reference/expressions.rst:1795 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1895,25 +1907,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1794 +#: ../../reference/expressions.rst:1804 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1802 +#: ../../reference/expressions.rst:1812 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1816 +#: ../../reference/expressions.rst:1826 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1825 +#: ../../reference/expressions.rst:1835 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1921,12 +1933,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1830 +#: ../../reference/expressions.rst:1840 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1835 +#: ../../reference/expressions.rst:1845 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1935,28 +1947,28 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1845 +#: ../../reference/expressions.rst:1855 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1849 +#: ../../reference/expressions.rst:1859 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1852 +#: ../../reference/expressions.rst:1862 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:1876 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1871 +#: ../../reference/expressions.rst:1881 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -1965,176 +1977,176 @@ msgid "" "left to right (except for exponentiation, which groups from right to left)." msgstr "" -#: ../../reference/expressions.rst:1877 +#: ../../reference/expressions.rst:1887 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1893 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1893 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1885 +#: ../../reference/expressions.rst:1895 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1887 +#: ../../reference/expressions.rst:1897 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1885 +#: ../../reference/expressions.rst:1895 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1891 +#: ../../reference/expressions.rst:1901 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1891 +#: ../../reference/expressions.rst:1901 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1894 +#: ../../reference/expressions.rst:1904 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1896 +#: ../../reference/expressions.rst:1906 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1896 +#: ../../reference/expressions.rst:1906 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1898 +#: ../../reference/expressions.rst:1908 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1898 +#: ../../reference/expressions.rst:1908 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1910 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1910 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:1904 +#: ../../reference/expressions.rst:1914 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:1904 +#: ../../reference/expressions.rst:1914 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1906 +#: ../../reference/expressions.rst:1916 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:1906 +#: ../../reference/expressions.rst:1916 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1918 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1918 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1920 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1920 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1912 +#: ../../reference/expressions.rst:1922 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:1912 +#: ../../reference/expressions.rst:1922 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1914 +#: ../../reference/expressions.rst:1924 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1914 +#: ../../reference/expressions.rst:1924 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1928 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1928 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1930 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1930 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1932 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1932 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1934 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1934 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1926 +#: ../../reference/expressions.rst:1936 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:1926 +#: ../../reference/expressions.rst:1936 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1938 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1938 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1933 +#: ../../reference/expressions.rst:1943 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1934 +#: ../../reference/expressions.rst:1944 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2146,7 +2158,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1953 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2154,7 +2166,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1948 +#: ../../reference/expressions.rst:1958 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2168,7 +2180,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1969 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2176,13 +2188,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:1964 +#: ../../reference/expressions.rst:1974 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:1967 +#: ../../reference/expressions.rst:1977 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2190,13 +2202,13 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:1972 +#: ../../reference/expressions.rst:1982 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:1975 +#: ../../reference/expressions.rst:1985 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 5918038772..4fc5da01e6 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-09-22 00:19+0000\n" "PO-Revision-Date: 2022-06-27 09:44+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -187,22 +187,32 @@ msgstr "" #: ../../tutorial/inputoutput.rst:136 msgid "" -"For a reference on these format specifications, see the reference guide for " -"the :ref:`formatspec`." -msgstr "若要參考這些格式化字串的規格,詳見 :ref:`formatspec` 參考指南。" +"The ``=`` specifier can be used to expand an expression to the text of the " +"expression, an equal sign, then the representation of the evaluated " +"expression:" +msgstr "" + +#: ../../tutorial/inputoutput.rst:145 +msgid "" +"See :ref:`self-documenting expressions ` for more " +"information on the ``=`` specifier. For a reference on these format " +"specifications, see the reference guide for the :ref:`formatspec`." +msgstr "" +"更多關於 ``=`` 說明符的資訊請見\\ :ref:`自文件性運算式 (self-documenting expressions) `。" +"若要參考這些格式化字串的規格,詳見 :ref:`formatspec` 參考指南。" -#: ../../tutorial/inputoutput.rst:142 +#: ../../tutorial/inputoutput.rst:152 msgid "The String format() Method" msgstr "字串的 format() method" -#: ../../tutorial/inputoutput.rst:144 +#: ../../tutorial/inputoutput.rst:154 msgid "Basic usage of the :meth:`str.format` method looks like this::" msgstr "" ":meth:`str.format` method 的基本用法如下:\n" "\n" "::" -#: ../../tutorial/inputoutput.rst:149 +#: ../../tutorial/inputoutput.rst:159 msgid "" "The brackets and characters within them (called format fields) are replaced " "with the objects passed into the :meth:`str.format` method. A number in the " @@ -215,7 +225,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:159 +#: ../../tutorial/inputoutput.rst:169 msgid "" "If keyword arguments are used in the :meth:`str.format` method, their values " "are referred to by using the name of the argument. ::" @@ -225,14 +235,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:166 +#: ../../tutorial/inputoutput.rst:176 msgid "Positional and keyword arguments can be arbitrarily combined::" msgstr "" "位置引數和關鍵字引數可以任意組合:\n" "\n" "::" -#: ../../tutorial/inputoutput.rst:172 +#: ../../tutorial/inputoutput.rst:182 msgid "" "If you have a really long format string that you don't want to split up, it " "would be nice if you could reference the variables to be formatted by name " @@ -245,7 +255,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:182 +#: ../../tutorial/inputoutput.rst:192 msgid "" "This could also be done by passing the ``table`` dictionary as keyword " "arguments with the ``**`` notation. ::" @@ -254,7 +264,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:189 +#: ../../tutorial/inputoutput.rst:199 msgid "" "This is particularly useful in combination with the built-in function :func:" "`vars`, which returns a dictionary containing all local variables." @@ -262,7 +272,7 @@ msgstr "" "與內建函式 :func:`vars` 組合使用時,這種方式特別實用。該函式可以回傳一個包含" "所有區域變數的 dictionary。" -#: ../../tutorial/inputoutput.rst:192 +#: ../../tutorial/inputoutput.rst:202 msgid "" "As an example, the following lines produce a tidily aligned set of columns " "giving integers and their squares and cubes::" @@ -271,7 +281,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:209 +#: ../../tutorial/inputoutput.rst:219 msgid "" "For a complete overview of string formatting with :meth:`str.format`, see :" "ref:`formatstrings`." @@ -279,18 +289,18 @@ msgstr "" "關於使用 :meth:`str.format` 進行字串格式化的完整概述,請見\\ :ref:" "`formatstrings`\\ 。" -#: ../../tutorial/inputoutput.rst:214 +#: ../../tutorial/inputoutput.rst:224 msgid "Manual String Formatting" msgstr "手動格式化字串" -#: ../../tutorial/inputoutput.rst:216 +#: ../../tutorial/inputoutput.rst:226 msgid "Here's the same table of squares and cubes, formatted manually::" msgstr "" "下面是以手動格式化完成的同一個平方及立方的表:\n" "\n" "::" -#: ../../tutorial/inputoutput.rst:234 +#: ../../tutorial/inputoutput.rst:244 msgid "" "(Note that the one space between each column was added by the way :func:" "`print` works: it always adds spaces between its arguments.)" @@ -298,7 +308,7 @@ msgstr "" "(請注意,使用 :func:`print` 讓每欄之間加入一個空格的方法:這種方法總是在其引" "數間加入空格。)" -#: ../../tutorial/inputoutput.rst:237 +#: ../../tutorial/inputoutput.rst:247 msgid "" "The :meth:`str.rjust` method of string objects right-justifies a string in a " "field of a given width by padding it with spaces on the left. There are " @@ -316,7 +326,7 @@ msgstr "" "況好,那種情況會讓值變得不正確。(如果你真的想截斷字串,可以加入像 ``x." "ljust(n)[:n]`` 這樣的切片運算。)" -#: ../../tutorial/inputoutput.rst:246 +#: ../../tutorial/inputoutput.rst:256 msgid "" "There is another method, :meth:`str.zfill`, which pads a numeric string on " "the left with zeros. It understands about plus and minus signs::" @@ -326,11 +336,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:258 +#: ../../tutorial/inputoutput.rst:268 msgid "Old string formatting" msgstr "格式化字串的舊方法" -#: ../../tutorial/inputoutput.rst:260 +#: ../../tutorial/inputoutput.rst:270 msgid "" "The % operator (modulo) can also be used for string formatting. Given " "``'string' % values``, instances of ``%`` in ``string`` are replaced with " @@ -343,16 +353,16 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:269 +#: ../../tutorial/inputoutput.rst:279 msgid "" "More information can be found in the :ref:`old-string-formatting` section." msgstr "更多資訊請見 :ref:`old-string-formatting`\\ 小節。" -#: ../../tutorial/inputoutput.rst:275 +#: ../../tutorial/inputoutput.rst:285 msgid "Reading and Writing Files" msgstr "讀寫檔案" -#: ../../tutorial/inputoutput.rst:281 +#: ../../tutorial/inputoutput.rst:291 msgid "" ":func:`open` returns a :term:`file object`, and is most commonly used with " "two positional arguments and one keyword argument: ``open(filename, mode, " @@ -361,7 +371,7 @@ msgstr "" ":func:`open` 回傳一個 :term:`file object`\\ ,而它最常使用的兩個位置引數和一" "個關鍵字引數是:\\ ``open(filename, mode, encoding=None)``" -#: ../../tutorial/inputoutput.rst:294 +#: ../../tutorial/inputoutput.rst:304 msgid "" "The first argument is a string containing the filename. The second argument " "is another string containing a few characters describing the way in which " @@ -379,7 +389,7 @@ msgstr "" "``'r+'`` 可以開啟檔案並進行讀取和寫入。\\ *mode* 引數是選擇性的,若省略時會預" "設為 ``'r'``。" -#: ../../tutorial/inputoutput.rst:303 +#: ../../tutorial/inputoutput.rst:313 msgid "" "Normally, files are opened in :dfn:`text mode`, that means, you read and " "write strings from and to the file, which are encoded in a specific " @@ -397,7 +407,7 @@ msgstr "" "`binary mode`\\ (二進制模式)開啟檔案,二進制模式資料以 :class:`bytes` 物件" "的形式被讀寫。以二進制模式開啟檔案時不可以指定 *encoding*\\ 。" -#: ../../tutorial/inputoutput.rst:313 +#: ../../tutorial/inputoutput.rst:323 msgid "" "In text mode, the default when reading is to convert platform-specific line " "endings (``\\n`` on Unix, ``\\r\\n`` on Windows) to just ``\\n``. When " @@ -413,7 +423,7 @@ msgstr "" "字檔案來說沒有問題,但會毀壞像是 :file:`JPEG` 或 :file:`EXE` 檔案中的二進制資" "料。在讀寫此類檔案時,注意一定要使用二進制模式。" -#: ../../tutorial/inputoutput.rst:321 +#: ../../tutorial/inputoutput.rst:331 msgid "" "It is good practice to use the :keyword:`with` keyword when dealing with " "file objects. The advantage is that the file is properly closed after its " @@ -427,7 +437,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:334 +#: ../../tutorial/inputoutput.rst:344 msgid "" "If you're not using the :keyword:`with` keyword, then you should call ``f." "close()`` to close the file and immediately free up any system resources " @@ -436,7 +446,7 @@ msgstr "" "如果你沒有使用 :keyword:`with` 關鍵字,則應呼叫 ``f.close()`` 關閉檔案,可以" "立即釋放被它所使用的系統資源。" -#: ../../tutorial/inputoutput.rst:339 +#: ../../tutorial/inputoutput.rst:349 msgid "" "Calling ``f.write()`` without using the :keyword:`!with` keyword or calling " "``f.close()`` **might** result in the arguments of ``f.write()`` not being " @@ -446,7 +456,7 @@ msgstr "" "即使程式成功退出,也\\ **可能**\\ 導致 ``f.write()`` 的引數沒有被完全寫入硬" "碟。" -#: ../../tutorial/inputoutput.rst:347 +#: ../../tutorial/inputoutput.rst:357 msgid "" "After a file object is closed, either by a :keyword:`with` statement or by " "calling ``f.close()``, attempts to use the file object will automatically " @@ -457,17 +467,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:361 +#: ../../tutorial/inputoutput.rst:371 msgid "Methods of File Objects" msgstr "檔案物件的 method" -#: ../../tutorial/inputoutput.rst:363 +#: ../../tutorial/inputoutput.rst:373 msgid "" "The rest of the examples in this section will assume that a file object " "called ``f`` has already been created." msgstr "本節其餘的範例皆假設一個名為 ``f`` 的檔案物件已被建立。" -#: ../../tutorial/inputoutput.rst:366 +#: ../../tutorial/inputoutput.rst:376 msgid "" "To read a file's contents, call ``f.read(size)``, which reads some quantity " "of data and returns it as a string (in text mode) or bytes object (in binary " @@ -487,7 +497,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:380 +#: ../../tutorial/inputoutput.rst:390 msgid "" "``f.readline()`` reads a single line from the file; a newline character (``" "\\n``) is left at the end of the string, and is only omitted on the last " @@ -503,7 +513,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:394 +#: ../../tutorial/inputoutput.rst:404 msgid "" "For reading lines from a file, you can loop over the file object. This is " "memory efficient, fast, and leads to simple code::" @@ -513,7 +523,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:403 +#: ../../tutorial/inputoutput.rst:413 msgid "" "If you want to read all the lines of a file in a list you can also use " "``list(f)`` or ``f.readlines()``." @@ -521,7 +531,7 @@ msgstr "" "如果你想把一個檔案的所有行讀進一個 list 裡,可以用 ``list(f)`` 或 ``f." "readlines()``。" -#: ../../tutorial/inputoutput.rst:406 +#: ../../tutorial/inputoutput.rst:416 msgid "" "``f.write(string)`` writes the contents of *string* to the file, returning " "the number of characters written. ::" @@ -530,7 +540,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:412 +#: ../../tutorial/inputoutput.rst:422 msgid "" "Other types of objects need to be converted -- either to a string (in text " "mode) or a bytes object (in binary mode) -- before writing them::" @@ -540,7 +550,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:420 +#: ../../tutorial/inputoutput.rst:430 msgid "" "``f.tell()`` returns an integer giving the file object's current position in " "the file represented as number of bytes from the beginning of the file when " @@ -549,7 +559,7 @@ msgstr "" "``f.tell()`` 回傳一個整數,它給出檔案物件在檔案中的當前位置,在二進制模式下表" "示為檔案開始至今的位元組數,在文字模式下表示為一個意義不明的數字。" -#: ../../tutorial/inputoutput.rst:424 +#: ../../tutorial/inputoutput.rst:434 msgid "" "To change the file object's position, use ``f.seek(offset, whence)``. The " "position is computed from adding *offset* to a reference point; the " @@ -566,7 +576,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:443 +#: ../../tutorial/inputoutput.rst:453 msgid "" "In text files (those opened without a ``b`` in the mode string), only seeks " "relative to the beginning of the file are allowed (the exception being " @@ -579,7 +589,7 @@ msgstr "" "的值,或是 0,才是有效的 *offset* 值。其他任何 *offset* 值都會產生未定義的行" "為。" -#: ../../tutorial/inputoutput.rst:449 +#: ../../tutorial/inputoutput.rst:459 msgid "" "File objects have some additional methods, such as :meth:`~file.isatty` and :" "meth:`~file.truncate` which are less frequently used; consult the Library " @@ -588,11 +598,11 @@ msgstr "" "檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~file.isatty` 和 :" "meth:`~file.truncate`\\ ;檔案物件的完整指南詳見程式庫參考手冊。" -#: ../../tutorial/inputoutput.rst:457 +#: ../../tutorial/inputoutput.rst:467 msgid "Saving structured data with :mod:`json`" msgstr "使用 :mod:`json` 儲存結構化資料" -#: ../../tutorial/inputoutput.rst:461 +#: ../../tutorial/inputoutput.rst:471 msgid "" "Strings can easily be written to and read from a file. Numbers take a bit " "more effort, since the :meth:`read` method only returns strings, which will " @@ -606,7 +616,7 @@ msgstr "" "樣的字串,並回傳數值 123。當你想儲存像是巢狀 list 和 dictionary(字典)等複雜" "的資料類型時,手動剖析 (parsing) 和序列化 (serializing) 就變得複雜。" -#: ../../tutorial/inputoutput.rst:468 +#: ../../tutorial/inputoutput.rst:478 msgid "" "Rather than having users constantly writing and debugging code to save " "complicated data types to files, Python allows you to use the popular data " @@ -625,7 +635,7 @@ msgstr "" "料則稱為 :dfn:`deserializing`\\ (反序列化)。在序列化和反序列化之間,表示物" "件的字串可以被儲存在檔案或資料中,或通過網路連接發送到遠端的機器。" -#: ../../tutorial/inputoutput.rst:479 +#: ../../tutorial/inputoutput.rst:489 msgid "" "The JSON format is commonly used by modern applications to allow for data " "exchange. Many programmers are already familiar with it, which makes it a " @@ -634,7 +644,7 @@ msgstr "" "JSON 格式經常地使用於現代應用程式的資料交換。許多程序設計師早已對它耳熟能詳," "使它成為提升互操作性 (interoperability) 的好選擇。" -#: ../../tutorial/inputoutput.rst:483 +#: ../../tutorial/inputoutput.rst:493 msgid "" "If you have an object ``x``, you can view its JSON string representation " "with a simple line of code::" @@ -643,7 +653,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:491 +#: ../../tutorial/inputoutput.rst:501 msgid "" "Another variant of the :func:`~json.dumps` function, called :func:`~json." "dump`, simply serializes the object to a :term:`text file`. So if ``f`` is " @@ -655,7 +665,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:497 +#: ../../tutorial/inputoutput.rst:507 msgid "" "To decode the object again, if ``f`` is a :term:`binary file` or :term:`text " "file` object which has been opened for reading::" @@ -665,7 +675,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/inputoutput.rst:503 +#: ../../tutorial/inputoutput.rst:513 msgid "" "JSON files must be encoded in UTF-8. Use ``encoding=\"utf-8\"`` when opening " "JSON file as a :term:`text file` for both of reading and writing." @@ -673,7 +683,7 @@ msgstr "" "JSON 檔案必須以 UTF-8 格式編碼。在開啟 JSON 檔案以作為一個可讀取與寫入的 :" "term:`text file` 時,要用 ``encoding=\"utf-8\"``。" -#: ../../tutorial/inputoutput.rst:506 +#: ../../tutorial/inputoutput.rst:516 msgid "" "This simple serialization technique can handle lists and dictionaries, but " "serializing arbitrary class instances in JSON requires a bit of extra " @@ -684,11 +694,11 @@ msgstr "" "class(類別)實例,則需要一些額外的工作。\\ :mod:`json` 模組的參考資料包含對" "此的說明。" -#: ../../tutorial/inputoutput.rst:512 +#: ../../tutorial/inputoutput.rst:522 msgid ":mod:`pickle` - the pickle module" msgstr ":mod:`pickle` - pickle 模組" -#: ../../tutorial/inputoutput.rst:514 +#: ../../tutorial/inputoutput.rst:524 msgid "" "Contrary to :ref:`JSON `, *pickle* is a protocol which allows the " "serialization of arbitrarily complex Python objects. As such, it is " diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index fa062a206f..f450efe8d2 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-03 00:15+0000\n" +"POT-Creation-Date: 2022-09-21 00:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3119,3 +3119,16 @@ msgid "" "` documentation. The default limit is 4300 digits in " "string form." msgstr "" + +#: ../../whatsnew/3.10.rst:2342 +msgid "Notable security feature in 3.10.8" +msgstr "" + +#: ../../whatsnew/3.10.rst:2344 +msgid "" +"The deprecated :mod:`mailcap` module now refuses to inject unsafe text " +"(filenames, MIME types, parameters) into shell commands. Instead of using " +"such text, it will warn and act as if a match was not found (or for test " +"commands, as if the test failed). (Contributed by Petr Viktorin in :gh:" +"`98966`.)" +msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index e623508aea..380140c9c0 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-07 00:13+0000\n" +"POT-Creation-Date: 2022-09-22 00:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -256,38 +256,38 @@ msgid "" "`36721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:255 +#: ../../whatsnew/3.8.rst:256 msgid "f-strings support ``=`` for self-documenting expressions and debugging" msgstr "" -#: ../../whatsnew/3.8.rst:257 +#: ../../whatsnew/3.8.rst:258 msgid "" "Added an ``=`` specifier to :term:`f-string`\\s. An f-string such as " "``f'{expr=}'`` will expand to the text of the expression, an equal sign, " "then the representation of the evaluated expression. For example:" msgstr "" -#: ../../whatsnew/3.8.rst:266 +#: ../../whatsnew/3.8.rst:267 msgid "" "The usual :ref:`f-string format specifiers ` allow more control " "over how the result of the expression is displayed::" msgstr "" -#: ../../whatsnew/3.8.rst:273 +#: ../../whatsnew/3.8.rst:274 msgid "" "The ``=`` specifier will display the whole expression so that calculations " "can be shown::" msgstr "" -#: ../../whatsnew/3.8.rst:279 +#: ../../whatsnew/3.8.rst:280 msgid "(Contributed by Eric V. Smith and Larry Hastings in :issue:`36817`.)" msgstr "" -#: ../../whatsnew/3.8.rst:283 +#: ../../whatsnew/3.8.rst:284 msgid "PEP 578: Python Runtime Audit Hooks" msgstr "" -#: ../../whatsnew/3.8.rst:285 +#: ../../whatsnew/3.8.rst:286 msgid "" "The PEP adds an Audit Hook and Verified Open Hook. Both are available from " "Python and native code, allowing applications and frameworks written in pure " @@ -296,150 +296,150 @@ msgid "" "is always enabled." msgstr "" -#: ../../whatsnew/3.8.rst:291 +#: ../../whatsnew/3.8.rst:292 msgid "See :pep:`578` for full details." msgstr "完整細節請見 :pep:`578`\\ 。" -#: ../../whatsnew/3.8.rst:295 +#: ../../whatsnew/3.8.rst:296 msgid "PEP 587: Python Initialization Configuration" msgstr "" -#: ../../whatsnew/3.8.rst:297 +#: ../../whatsnew/3.8.rst:298 msgid "" "The :pep:`587` adds a new C API to configure the Python Initialization " "providing finer control on the whole configuration and better error " "reporting." msgstr "" -#: ../../whatsnew/3.8.rst:300 +#: ../../whatsnew/3.8.rst:301 msgid "New structures:" msgstr "" -#: ../../whatsnew/3.8.rst:302 +#: ../../whatsnew/3.8.rst:303 msgid ":c:type:`PyConfig`" msgstr ":c:type:`PyConfig`" -#: ../../whatsnew/3.8.rst:303 +#: ../../whatsnew/3.8.rst:304 msgid ":c:type:`PyPreConfig`" msgstr ":c:type:`PyPreConfig`" -#: ../../whatsnew/3.8.rst:304 +#: ../../whatsnew/3.8.rst:305 msgid ":c:type:`PyStatus`" msgstr ":c:type:`PyStatus`" -#: ../../whatsnew/3.8.rst:305 +#: ../../whatsnew/3.8.rst:306 msgid ":c:type:`PyWideStringList`" msgstr ":c:type:`PyWideStringList`" -#: ../../whatsnew/3.8.rst:307 +#: ../../whatsnew/3.8.rst:308 msgid "New functions:" msgstr "" -#: ../../whatsnew/3.8.rst:309 +#: ../../whatsnew/3.8.rst:310 msgid ":c:func:`PyConfig_Clear`" msgstr ":c:func:`PyConfig_Clear`" -#: ../../whatsnew/3.8.rst:310 +#: ../../whatsnew/3.8.rst:311 msgid ":c:func:`PyConfig_InitIsolatedConfig`" msgstr ":c:func:`PyConfig_InitIsolatedConfig`" -#: ../../whatsnew/3.8.rst:311 +#: ../../whatsnew/3.8.rst:312 msgid ":c:func:`PyConfig_InitPythonConfig`" msgstr ":c:func:`PyConfig_InitPythonConfig`" -#: ../../whatsnew/3.8.rst:312 +#: ../../whatsnew/3.8.rst:313 msgid ":c:func:`PyConfig_Read`" msgstr ":c:func:`PyConfig_Read`" -#: ../../whatsnew/3.8.rst:313 +#: ../../whatsnew/3.8.rst:314 msgid ":c:func:`PyConfig_SetArgv`" msgstr ":c:func:`PyConfig_SetArgv`" -#: ../../whatsnew/3.8.rst:314 +#: ../../whatsnew/3.8.rst:315 msgid ":c:func:`PyConfig_SetBytesArgv`" msgstr ":c:func:`PyConfig_SetBytesArgv`" -#: ../../whatsnew/3.8.rst:315 +#: ../../whatsnew/3.8.rst:316 msgid ":c:func:`PyConfig_SetBytesString`" msgstr ":c:func:`PyConfig_SetBytesString`" -#: ../../whatsnew/3.8.rst:316 +#: ../../whatsnew/3.8.rst:317 msgid ":c:func:`PyConfig_SetString`" msgstr ":c:func:`PyConfig_SetString`" -#: ../../whatsnew/3.8.rst:317 +#: ../../whatsnew/3.8.rst:318 msgid ":c:func:`PyPreConfig_InitIsolatedConfig`" msgstr ":c:func:`PyPreConfig_InitIsolatedConfig`" -#: ../../whatsnew/3.8.rst:318 +#: ../../whatsnew/3.8.rst:319 msgid ":c:func:`PyPreConfig_InitPythonConfig`" msgstr ":c:func:`PyPreConfig_InitPythonConfig`" -#: ../../whatsnew/3.8.rst:319 +#: ../../whatsnew/3.8.rst:320 msgid ":c:func:`PyStatus_Error`" msgstr ":c:func:`PyStatus_Error`" -#: ../../whatsnew/3.8.rst:320 +#: ../../whatsnew/3.8.rst:321 msgid ":c:func:`PyStatus_Exception`" msgstr ":c:func:`PyStatus_Exception`" -#: ../../whatsnew/3.8.rst:321 +#: ../../whatsnew/3.8.rst:322 msgid ":c:func:`PyStatus_Exit`" msgstr ":c:func:`PyStatus_Exit`" -#: ../../whatsnew/3.8.rst:322 +#: ../../whatsnew/3.8.rst:323 msgid ":c:func:`PyStatus_IsError`" msgstr ":c:func:`PyStatus_IsError`" -#: ../../whatsnew/3.8.rst:323 +#: ../../whatsnew/3.8.rst:324 msgid ":c:func:`PyStatus_IsExit`" msgstr ":c:func:`PyStatus_IsExit`" -#: ../../whatsnew/3.8.rst:324 +#: ../../whatsnew/3.8.rst:325 msgid ":c:func:`PyStatus_NoMemory`" msgstr ":c:func:`PyStatus_NoMemory`" -#: ../../whatsnew/3.8.rst:325 +#: ../../whatsnew/3.8.rst:326 msgid ":c:func:`PyStatus_Ok`" msgstr ":c:func:`PyStatus_Ok`" -#: ../../whatsnew/3.8.rst:326 +#: ../../whatsnew/3.8.rst:327 msgid ":c:func:`PyWideStringList_Append`" msgstr ":c:func:`PyWideStringList_Append`" -#: ../../whatsnew/3.8.rst:327 +#: ../../whatsnew/3.8.rst:328 msgid ":c:func:`PyWideStringList_Insert`" msgstr ":c:func:`PyWideStringList_Insert`" -#: ../../whatsnew/3.8.rst:328 +#: ../../whatsnew/3.8.rst:329 msgid ":c:func:`Py_BytesMain`" msgstr ":c:func:`Py_BytesMain`" -#: ../../whatsnew/3.8.rst:329 +#: ../../whatsnew/3.8.rst:330 msgid ":c:func:`Py_ExitStatusException`" msgstr ":c:func:`Py_ExitStatusException`" -#: ../../whatsnew/3.8.rst:330 +#: ../../whatsnew/3.8.rst:331 msgid ":c:func:`Py_InitializeFromConfig`" msgstr ":c:func:`Py_InitializeFromConfig`" -#: ../../whatsnew/3.8.rst:331 +#: ../../whatsnew/3.8.rst:332 msgid ":c:func:`Py_PreInitialize`" msgstr ":c:func:`Py_PreInitialize`" -#: ../../whatsnew/3.8.rst:332 +#: ../../whatsnew/3.8.rst:333 msgid ":c:func:`Py_PreInitializeFromArgs`" msgstr ":c:func:`Py_PreInitializeFromArgs`" -#: ../../whatsnew/3.8.rst:333 +#: ../../whatsnew/3.8.rst:334 msgid ":c:func:`Py_PreInitializeFromBytesArgs`" msgstr ":c:func:`Py_PreInitializeFromBytesArgs`" -#: ../../whatsnew/3.8.rst:334 +#: ../../whatsnew/3.8.rst:335 msgid ":c:func:`Py_RunMain`" msgstr ":c:func:`Py_RunMain`" -#: ../../whatsnew/3.8.rst:336 +#: ../../whatsnew/3.8.rst:337 msgid "" "This PEP also adds ``_PyRuntimeState.preconfig`` (:c:type:`PyPreConfig` " "type) and ``PyInterpreterState.config`` (:c:type:`PyConfig` type) fields to " @@ -448,52 +448,52 @@ msgid "" "private variables." msgstr "" -#: ../../whatsnew/3.8.rst:342 +#: ../../whatsnew/3.8.rst:343 msgid "" "See :ref:`Python Initialization Configuration ` for the " "documentation." msgstr "" -#: ../../whatsnew/3.8.rst:345 +#: ../../whatsnew/3.8.rst:346 msgid "See :pep:`587` for a full description." msgstr "完整敘述請見 :pep:`587`\\ 。" -#: ../../whatsnew/3.8.rst:347 +#: ../../whatsnew/3.8.rst:348 msgid "(Contributed by Victor Stinner in :issue:`36763`.)" msgstr "" -#: ../../whatsnew/3.8.rst:351 +#: ../../whatsnew/3.8.rst:352 msgid "PEP 590: Vectorcall: a fast calling protocol for CPython" msgstr "" -#: ../../whatsnew/3.8.rst:353 +#: ../../whatsnew/3.8.rst:354 msgid "" ":ref:`vectorcall` is added to the Python/C API. It is meant to formalize " "existing optimizations which were already done for various classes. Any :ref:" "`static type ` implementing a callable can use this protocol." msgstr "" -#: ../../whatsnew/3.8.rst:359 +#: ../../whatsnew/3.8.rst:360 msgid "" "This is currently provisional. The aim is to make it fully public in Python " "3.9." msgstr "" -#: ../../whatsnew/3.8.rst:362 +#: ../../whatsnew/3.8.rst:363 msgid "See :pep:`590` for a full description." msgstr "完整敘述請見 :pep:`590`\\ 。" -#: ../../whatsnew/3.8.rst:364 +#: ../../whatsnew/3.8.rst:365 msgid "" "(Contributed by Jeroen Demeyer, Mark Shannon and Petr Viktorin in :issue:" "`36974`.)" msgstr "" -#: ../../whatsnew/3.8.rst:368 +#: ../../whatsnew/3.8.rst:369 msgid "Pickle protocol 5 with out-of-band data buffers" msgstr "" -#: ../../whatsnew/3.8.rst:370 +#: ../../whatsnew/3.8.rst:371 msgid "" "When :mod:`pickle` is used to transfer large data between Python processes " "in order to take advantage of multi-core or multi-machine processing, it is " @@ -501,33 +501,33 @@ msgid "" "by applying custom techniques such as data-dependent compression." msgstr "" -#: ../../whatsnew/3.8.rst:375 +#: ../../whatsnew/3.8.rst:376 msgid "" "The :mod:`pickle` protocol 5 introduces support for out-of-band buffers " "where :pep:`3118`-compatible data can be transmitted separately from the " "main pickle stream, at the discretion of the communication layer." msgstr "" -#: ../../whatsnew/3.8.rst:379 +#: ../../whatsnew/3.8.rst:380 msgid "See :pep:`574` for a full description." msgstr "完整敘述請見 :pep:`574`\\ 。" -#: ../../whatsnew/3.8.rst:381 +#: ../../whatsnew/3.8.rst:382 msgid "(Contributed by Antoine Pitrou in :issue:`36785`.)" msgstr "" -#: ../../whatsnew/3.8.rst:385 +#: ../../whatsnew/3.8.rst:386 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.8.rst:387 +#: ../../whatsnew/3.8.rst:388 msgid "" "A :keyword:`continue` statement was illegal in the :keyword:`finally` clause " "due to a problem with the implementation. In Python 3.8 this restriction " "was lifted. (Contributed by Serhiy Storchaka in :issue:`32489`.)" msgstr "" -#: ../../whatsnew/3.8.rst:392 +#: ../../whatsnew/3.8.rst:393 msgid "" "The :class:`bool`, :class:`int`, and :class:`fractions.Fraction` types now " "have an :meth:`~int.as_integer_ratio` method like that found in :class:" @@ -537,7 +537,7 @@ msgid "" "`33073` and Raymond Hettinger in :issue:`37819`.)" msgstr "" -#: ../../whatsnew/3.8.rst:400 +#: ../../whatsnew/3.8.rst:401 msgid "" "Constructors of :class:`int`, :class:`float` and :class:`complex` will now " "use the :meth:`~object.__index__` special method, if available and the " @@ -546,23 +546,23 @@ msgid "" "Storchaka in :issue:`20092`.)" msgstr "" -#: ../../whatsnew/3.8.rst:406 +#: ../../whatsnew/3.8.rst:407 msgid "" "Added support of ``\\N{name}`` escapes in :mod:`regular expressions `::" msgstr "" -#: ../../whatsnew/3.8.rst:413 +#: ../../whatsnew/3.8.rst:414 msgid "" "(Contributed by Jonathan Eunice and Serhiy Storchaka in :issue:`30688`.)" msgstr "" -#: ../../whatsnew/3.8.rst:415 +#: ../../whatsnew/3.8.rst:416 msgid "" "Dict and dictviews are now iterable in reversed insertion order using :func:" "`reversed`. (Contributed by Rémi Lapeyre in :issue:`33462`.)" msgstr "" -#: ../../whatsnew/3.8.rst:418 +#: ../../whatsnew/3.8.rst:419 msgid "" "The syntax allowed for keyword names in function calls was further " "restricted. In particular, ``f((keyword)=arg)`` is no longer allowed. It was " @@ -571,18 +571,18 @@ msgid "" "issue:`34641`.)" msgstr "" -#: ../../whatsnew/3.8.rst:424 +#: ../../whatsnew/3.8.rst:425 msgid "" "Generalized iterable unpacking in :keyword:`yield` and :keyword:`return` " "statements no longer requires enclosing parentheses. This brings the *yield* " "and *return* syntax into better agreement with normal assignment syntax::" msgstr "" -#: ../../whatsnew/3.8.rst:436 +#: ../../whatsnew/3.8.rst:437 msgid "(Contributed by David Cuthbert and Jordan Chapman in :issue:`32117`.)" msgstr "" -#: ../../whatsnew/3.8.rst:438 +#: ../../whatsnew/3.8.rst:439 msgid "" "When a comma is missed in code such as ``[(10, 20) (30, 40)]``, the compiler " "displays a :exc:`SyntaxWarning` with a helpful suggestion. This improves on " @@ -590,7 +590,7 @@ msgid "" "callable. (Contributed by Serhiy Storchaka in :issue:`15248`.)" msgstr "" -#: ../../whatsnew/3.8.rst:444 +#: ../../whatsnew/3.8.rst:445 msgid "" "Arithmetic operations between subclasses of :class:`datetime.date` or :class:" "`datetime.datetime` and :class:`datetime.timedelta` objects now return an " @@ -600,7 +600,7 @@ msgid "" "datetime.astimezone`. (Contributed by Paul Ganssle in :issue:`32417`.)" msgstr "" -#: ../../whatsnew/3.8.rst:452 +#: ../../whatsnew/3.8.rst:453 msgid "" "When the Python interpreter is interrupted by Ctrl-C (SIGINT) and the " "resulting :exc:`KeyboardInterrupt` exception is not caught, the Python " @@ -610,7 +610,7 @@ msgid "" "sessions. (Contributed by Google via Gregory P. Smith in :issue:`1054041`.)" msgstr "" -#: ../../whatsnew/3.8.rst:459 +#: ../../whatsnew/3.8.rst:460 msgid "" "Some advanced styles of programming require updating the :class:`types." "CodeType` object for an existing function. Since code objects are " @@ -620,17 +620,17 @@ msgid "" "altered parameters." msgstr "" -#: ../../whatsnew/3.8.rst:466 +#: ../../whatsnew/3.8.rst:467 msgid "" "Here's an example that alters the :func:`statistics.mean` function to " "prevent the *data* parameter from being used as a keyword argument::" msgstr "" -#: ../../whatsnew/3.8.rst:478 +#: ../../whatsnew/3.8.rst:479 msgid "(Contributed by Victor Stinner in :issue:`37032`.)" msgstr "" -#: ../../whatsnew/3.8.rst:480 +#: ../../whatsnew/3.8.rst:481 msgid "" "For integers, the three-argument form of the :func:`pow` function now " "permits the exponent to be negative in the case where the base is relatively " @@ -641,7 +641,7 @@ msgid "" "38 modulo 137, write::" msgstr "" -#: ../../whatsnew/3.8.rst:494 +#: ../../whatsnew/3.8.rst:495 msgid "" "Modular inverses arise in the solution of `linear Diophantine equations " "`_. For example, to find " @@ -649,28 +649,28 @@ msgid "" "(mod 147)`` then solve:" msgstr "" -#: ../../whatsnew/3.8.rst:504 +#: ../../whatsnew/3.8.rst:505 msgid "(Contributed by Mark Dickinson in :issue:`36027`.)" msgstr "" -#: ../../whatsnew/3.8.rst:506 +#: ../../whatsnew/3.8.rst:507 msgid "" "Dict comprehensions have been synced-up with dict literals so that the key " "is computed first and the value second::" msgstr "" -#: ../../whatsnew/3.8.rst:521 +#: ../../whatsnew/3.8.rst:522 msgid "" "The guaranteed execution order is helpful with assignment expressions " "because variables assigned in the key expression will be available in the " "value expression::" msgstr "" -#: ../../whatsnew/3.8.rst:531 +#: ../../whatsnew/3.8.rst:532 msgid "(Contributed by Jörn Heissler in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:533 +#: ../../whatsnew/3.8.rst:534 msgid "" "The :meth:`object.__reduce__` method can now return a tuple from two to six " "elements long. Formerly, five was the limit. The new, optional sixth " @@ -681,102 +681,102 @@ msgid "" "issue:`35900`.)" msgstr "" -#: ../../whatsnew/3.8.rst:542 +#: ../../whatsnew/3.8.rst:543 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.8.rst:544 +#: ../../whatsnew/3.8.rst:545 msgid "" "The new :mod:`importlib.metadata` module provides (provisional) support for " "reading metadata from third-party packages. For example, it can extract an " "installed package's version number, list of entry points, and more::" msgstr "" -#: ../../whatsnew/3.8.rst:563 +#: ../../whatsnew/3.8.rst:564 msgid "(Contributed by Barry Warsaw and Jason R. Coombs in :issue:`34632`.)" msgstr "" -#: ../../whatsnew/3.8.rst:567 +#: ../../whatsnew/3.8.rst:568 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.8.rst:570 +#: ../../whatsnew/3.8.rst:571 msgid "ast" msgstr "ast" -#: ../../whatsnew/3.8.rst:572 +#: ../../whatsnew/3.8.rst:573 msgid "" "AST nodes now have ``end_lineno`` and ``end_col_offset`` attributes, which " "give the precise location of the end of the node. (This only applies to " "nodes that have ``lineno`` and ``col_offset`` attributes.)" msgstr "" -#: ../../whatsnew/3.8.rst:576 +#: ../../whatsnew/3.8.rst:577 msgid "" "New function :func:`ast.get_source_segment` returns the source code for a " "specific AST node." msgstr "" -#: ../../whatsnew/3.8.rst:579 +#: ../../whatsnew/3.8.rst:580 msgid "(Contributed by Ivan Levkivskyi in :issue:`33416`.)" msgstr "" -#: ../../whatsnew/3.8.rst:581 +#: ../../whatsnew/3.8.rst:582 msgid "The :func:`ast.parse` function has some new flags:" msgstr "" -#: ../../whatsnew/3.8.rst:583 +#: ../../whatsnew/3.8.rst:584 msgid "" "``type_comments=True`` causes it to return the text of :pep:`484` and :pep:" "`526` type comments associated with certain AST nodes;" msgstr "" -#: ../../whatsnew/3.8.rst:586 +#: ../../whatsnew/3.8.rst:587 msgid "" "``mode='func_type'`` can be used to parse :pep:`484` \"signature type " "comments\" (returned for function definition AST nodes);" msgstr "" -#: ../../whatsnew/3.8.rst:589 +#: ../../whatsnew/3.8.rst:590 msgid "" "``feature_version=(3, N)`` allows specifying an earlier Python 3 version. " "For example, ``feature_version=(3, 4)`` will treat :keyword:`async` and :" "keyword:`await` as non-reserved words." msgstr "" -#: ../../whatsnew/3.8.rst:593 +#: ../../whatsnew/3.8.rst:594 msgid "(Contributed by Guido van Rossum in :issue:`35766`.)" msgstr "" -#: ../../whatsnew/3.8.rst:597 +#: ../../whatsnew/3.8.rst:598 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.8.rst:599 +#: ../../whatsnew/3.8.rst:600 msgid "" ":func:`asyncio.run` has graduated from the provisional to stable API. This " "function can be used to execute a :term:`coroutine` and return the result " "while automatically managing the event loop. For example::" msgstr "" -#: ../../whatsnew/3.8.rst:611 +#: ../../whatsnew/3.8.rst:612 msgid "This is *roughly* equivalent to::" msgstr "" "這\\ *大致*\\ 等價於:\n" "\n" "::" -#: ../../whatsnew/3.8.rst:628 +#: ../../whatsnew/3.8.rst:629 msgid "" "The actual implementation is significantly more complex. Thus, :func:" "`asyncio.run` should be the preferred way of running asyncio programs." msgstr "" -#: ../../whatsnew/3.8.rst:631 +#: ../../whatsnew/3.8.rst:632 msgid "(Contributed by Yury Selivanov in :issue:`32314`.)" msgstr "" -#: ../../whatsnew/3.8.rst:633 +#: ../../whatsnew/3.8.rst:634 msgid "" "Running ``python -m asyncio`` launches a natively async REPL. This allows " "rapid experimentation with code that has a top-level :keyword:`await`. " @@ -784,11 +784,11 @@ msgid "" "spawn a new event loop on every invocation:" msgstr "" -#: ../../whatsnew/3.8.rst:648 +#: ../../whatsnew/3.8.rst:649 msgid "(Contributed by Yury Selivanov in :issue:`37028`.)" msgstr "" -#: ../../whatsnew/3.8.rst:650 ../../whatsnew/3.8.rst:1966 +#: ../../whatsnew/3.8.rst:651 ../../whatsnew/3.8.rst:1967 msgid "" "The exception :class:`asyncio.CancelledError` now inherits from :class:" "`BaseException` rather than :class:`Exception` and no longer inherits from :" @@ -796,32 +796,32 @@ msgid "" "in :issue:`32528`.)" msgstr "" -#: ../../whatsnew/3.8.rst:655 +#: ../../whatsnew/3.8.rst:656 msgid "" "On Windows, the default event loop is now :class:`~asyncio." "ProactorEventLoop`. (Contributed by Victor Stinner in :issue:`34687`.)" msgstr "" -#: ../../whatsnew/3.8.rst:658 +#: ../../whatsnew/3.8.rst:659 msgid "" ":class:`~asyncio.ProactorEventLoop` now also supports UDP. (Contributed by " "Adam Meily and Andrew Svetlov in :issue:`29883`.)" msgstr "" -#: ../../whatsnew/3.8.rst:661 +#: ../../whatsnew/3.8.rst:662 msgid "" ":class:`~asyncio.ProactorEventLoop` can now be interrupted by :exc:" "`KeyboardInterrupt` (\"CTRL+C\"). (Contributed by Vladimir Matveev in :issue:" "`23057`.)" msgstr "" -#: ../../whatsnew/3.8.rst:665 +#: ../../whatsnew/3.8.rst:666 msgid "" "Added :meth:`asyncio.Task.get_coro` for getting the wrapped coroutine within " "an :class:`asyncio.Task`. (Contributed by Alex Grönholm in :issue:`36999`.)" msgstr "" -#: ../../whatsnew/3.8.rst:669 +#: ../../whatsnew/3.8.rst:670 msgid "" "Asyncio tasks can now be named, either by passing the ``name`` keyword " "argument to :func:`asyncio.create_task` or the :meth:`~asyncio.loop." @@ -832,7 +832,7 @@ msgid "" "issue:`34270`.)" msgstr "" -#: ../../whatsnew/3.8.rst:677 +#: ../../whatsnew/3.8.rst:678 msgid "" "Added support for `Happy Eyeballs `_ to :func:`asyncio.loop.create_connection`. To specify the " @@ -842,11 +842,11 @@ msgid "" "connect using both. (Contributed by twisteroid ambassador in :issue:`33530`.)" msgstr "" -#: ../../whatsnew/3.8.rst:687 +#: ../../whatsnew/3.8.rst:688 msgid "builtins" msgstr "builtins" -#: ../../whatsnew/3.8.rst:689 +#: ../../whatsnew/3.8.rst:690 msgid "" "The :func:`compile` built-in has been improved to accept the ``ast." "PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag. With this new flag passed, :func:" @@ -856,11 +856,11 @@ msgid "" "(Contributed by Matthias Bussonnier in :issue:`34616`)" msgstr "" -#: ../../whatsnew/3.8.rst:698 +#: ../../whatsnew/3.8.rst:699 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.8.rst:700 +#: ../../whatsnew/3.8.rst:701 msgid "" "The :meth:`~collections.somenamedtuple._asdict` method for :func:" "`collections.namedtuple` now returns a :class:`dict` instead of a :class:" @@ -871,25 +871,25 @@ msgid "" "issue:`35864`.)" msgstr "" -#: ../../whatsnew/3.8.rst:710 +#: ../../whatsnew/3.8.rst:711 msgid "cProfile" msgstr "cProfile" -#: ../../whatsnew/3.8.rst:712 +#: ../../whatsnew/3.8.rst:713 msgid "" "The :class:`cProfile.Profile ` class can now be used as a " "context manager. Profile a block of code by running::" msgstr "" -#: ../../whatsnew/3.8.rst:721 +#: ../../whatsnew/3.8.rst:722 msgid "(Contributed by Scott Sanderson in :issue:`29235`.)" msgstr "" -#: ../../whatsnew/3.8.rst:725 +#: ../../whatsnew/3.8.rst:726 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.8.rst:727 +#: ../../whatsnew/3.8.rst:728 msgid "" "The :class:`csv.DictReader` now returns instances of :class:`dict` instead " "of a :class:`collections.OrderedDict`. The tool is now faster and uses less " @@ -897,22 +897,22 @@ msgid "" "in :issue:`34003`.)" msgstr "" -#: ../../whatsnew/3.8.rst:734 +#: ../../whatsnew/3.8.rst:735 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.8.rst:736 +#: ../../whatsnew/3.8.rst:737 msgid "" "Added a new variable holding structured version information for the " "underlying ncurses library: :data:`~curses.ncurses_version`. (Contributed by " "Serhiy Storchaka in :issue:`31680`.)" msgstr "" -#: ../../whatsnew/3.8.rst:742 +#: ../../whatsnew/3.8.rst:743 msgid "ctypes" msgstr "ctypes" -#: ../../whatsnew/3.8.rst:744 +#: ../../whatsnew/3.8.rst:745 msgid "" "On Windows, :class:`~ctypes.CDLL` and subclasses now accept a *winmode* " "parameter to specify flags for the underlying ``LoadLibraryEx`` call. The " @@ -922,11 +922,11 @@ msgid "" "add_dll_directory`. (Contributed by Steve Dower in :issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:753 +#: ../../whatsnew/3.8.rst:754 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.8.rst:755 +#: ../../whatsnew/3.8.rst:756 msgid "" "Added new alternate constructors :meth:`datetime.date.fromisocalendar` and :" "meth:`datetime.datetime.fromisocalendar`, which construct :class:`date` and :" @@ -935,85 +935,85 @@ msgid "" "(Contributed by Paul Ganssle in :issue:`36004`.)" msgstr "" -#: ../../whatsnew/3.8.rst:763 +#: ../../whatsnew/3.8.rst:764 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.8.rst:765 +#: ../../whatsnew/3.8.rst:766 msgid "" ":func:`functools.lru_cache` can now be used as a straight decorator rather " "than as a function returning a decorator. So both of these are now " "supported::" msgstr "" -#: ../../whatsnew/3.8.rst:776 +#: ../../whatsnew/3.8.rst:777 msgid "(Contributed by Raymond Hettinger in :issue:`36772`.)" msgstr "" -#: ../../whatsnew/3.8.rst:778 +#: ../../whatsnew/3.8.rst:779 msgid "" "Added a new :func:`functools.cached_property` decorator, for computed " "properties cached for the life of the instance. ::" msgstr "" -#: ../../whatsnew/3.8.rst:792 +#: ../../whatsnew/3.8.rst:793 msgid "(Contributed by Carl Meyer in :issue:`21145`)" msgstr "" -#: ../../whatsnew/3.8.rst:795 +#: ../../whatsnew/3.8.rst:796 msgid "" "Added a new :func:`functools.singledispatchmethod` decorator that converts " "methods into :term:`generic functions ` using :term:" "`single dispatch`::" msgstr "" -#: ../../whatsnew/3.8.rst:817 +#: ../../whatsnew/3.8.rst:818 msgid "(Contributed by Ethan Smith in :issue:`32380`)" msgstr "" -#: ../../whatsnew/3.8.rst:820 +#: ../../whatsnew/3.8.rst:821 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.8.rst:822 +#: ../../whatsnew/3.8.rst:823 msgid "" ":func:`~gc.get_objects` can now receive an optional *generation* parameter " "indicating a generation to get objects from. (Contributed by Pablo Galindo " "in :issue:`36016`.)" msgstr "" -#: ../../whatsnew/3.8.rst:828 +#: ../../whatsnew/3.8.rst:829 msgid "gettext" msgstr "gettext" -#: ../../whatsnew/3.8.rst:830 +#: ../../whatsnew/3.8.rst:831 msgid "" "Added :func:`~gettext.pgettext` and its variants. (Contributed by Franz " "Glasner, Éric Araujo, and Cheryl Sabella in :issue:`2504`.)" msgstr "" -#: ../../whatsnew/3.8.rst:835 +#: ../../whatsnew/3.8.rst:836 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.8.rst:837 +#: ../../whatsnew/3.8.rst:838 msgid "" "Added the *mtime* parameter to :func:`gzip.compress` for reproducible " "output. (Contributed by Guo Ci Teo in :issue:`34898`.)" msgstr "" -#: ../../whatsnew/3.8.rst:840 +#: ../../whatsnew/3.8.rst:841 msgid "" "A :exc:`~gzip.BadGzipFile` exception is now raised instead of :exc:`OSError` " "for certain types of invalid or corrupt gzip files. (Contributed by Filip " "Gruszczyński, Michele Orrù, and Zackery Spytz in :issue:`6584`.)" msgstr "" -#: ../../whatsnew/3.8.rst:847 +#: ../../whatsnew/3.8.rst:848 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.8.rst:849 +#: ../../whatsnew/3.8.rst:850 msgid "" "Output over N lines (50 by default) is squeezed down to a button. N can be " "changed in the PyShell section of the General page of the Settings dialog. " @@ -1023,7 +1023,7 @@ msgid "" "button. (Contributed by Tal Einat in :issue:`1529353`.)" msgstr "" -#: ../../whatsnew/3.8.rst:856 +#: ../../whatsnew/3.8.rst:857 msgid "" "Add \"Run Customized\" to the Run menu to run a module with customized " "settings. Any command line arguments entered are added to sys.argv. They " @@ -1032,7 +1032,7 @@ msgid "" "Sabella, Terry Jan Reedy, and others in :issue:`5680` and :issue:`37627`.)" msgstr "" -#: ../../whatsnew/3.8.rst:862 +#: ../../whatsnew/3.8.rst:863 msgid "" "Added optional line numbers for IDLE editor windows. Windows open without " "line numbers unless set otherwise in the General tab of the configuration " @@ -1041,7 +1041,7 @@ msgid "" "`17535`.)" msgstr "" -#: ../../whatsnew/3.8.rst:868 +#: ../../whatsnew/3.8.rst:869 msgid "" "OS native encoding is now used for converting between Python strings and Tcl " "objects. This allows IDLE to work with emoji and other non-BMP characters. " @@ -1051,37 +1051,37 @@ msgid "" "solved by Serhiy Storchaka in :issue:`13153`.)" msgstr "" -#: ../../whatsnew/3.8.rst:875 +#: ../../whatsnew/3.8.rst:876 msgid "New in 3.8.1:" msgstr "" -#: ../../whatsnew/3.8.rst:877 +#: ../../whatsnew/3.8.rst:878 msgid "" "Add option to toggle cursor blink off. (Contributed by Zackery Spytz in :" "issue:`4603`.)" msgstr "" -#: ../../whatsnew/3.8.rst:880 +#: ../../whatsnew/3.8.rst:881 msgid "" "Escape key now closes IDLE completion windows. (Contributed by Johnny " "Najera in :issue:`38944`.)" msgstr "" -#: ../../whatsnew/3.8.rst:883 +#: ../../whatsnew/3.8.rst:884 msgid "The changes above have been backported to 3.7 maintenance releases." msgstr "" -#: ../../whatsnew/3.8.rst:885 +#: ../../whatsnew/3.8.rst:886 msgid "" "Add keywords to module name completion list. (Contributed by Terry J. Reedy " "in :issue:`37765`.)" msgstr "" -#: ../../whatsnew/3.8.rst:889 +#: ../../whatsnew/3.8.rst:890 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.8.rst:891 +#: ../../whatsnew/3.8.rst:892 msgid "" "The :func:`inspect.getdoc` function can now find docstrings for " "``__slots__`` if that attribute is a :class:`dict` where the values are " @@ -1089,15 +1089,15 @@ msgid "" "have for :func:`property`, :func:`classmethod`, and :func:`staticmethod`::" msgstr "" -#: ../../whatsnew/3.8.rst:903 +#: ../../whatsnew/3.8.rst:904 msgid "(Contributed by Raymond Hettinger in :issue:`36326`.)" msgstr "" -#: ../../whatsnew/3.8.rst:907 +#: ../../whatsnew/3.8.rst:908 msgid "io" msgstr "io" -#: ../../whatsnew/3.8.rst:909 +#: ../../whatsnew/3.8.rst:910 msgid "" "In development mode (:option:`-X` ``env``) and in :ref:`debug build `, the :class:`io.IOBase` finalizer now logs the exception if the " @@ -1105,35 +1105,35 @@ msgid "" "release build. (Contributed by Victor Stinner in :issue:`18748`.)" msgstr "" -#: ../../whatsnew/3.8.rst:916 +#: ../../whatsnew/3.8.rst:917 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.8.rst:918 +#: ../../whatsnew/3.8.rst:919 msgid "" "The :func:`itertools.accumulate` function added an option *initial* keyword " "argument to specify an initial value::" msgstr "" -#: ../../whatsnew/3.8.rst:925 +#: ../../whatsnew/3.8.rst:926 msgid "(Contributed by Lisa Roach in :issue:`34659`.)" msgstr "" -#: ../../whatsnew/3.8.rst:929 +#: ../../whatsnew/3.8.rst:930 msgid "json.tool" msgstr "json.tool" -#: ../../whatsnew/3.8.rst:931 +#: ../../whatsnew/3.8.rst:932 msgid "" "Add option ``--json-lines`` to parse every input line as a separate JSON " "object. (Contributed by Weipeng Hong in :issue:`31553`.)" msgstr "" -#: ../../whatsnew/3.8.rst:936 +#: ../../whatsnew/3.8.rst:937 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.8.rst:938 +#: ../../whatsnew/3.8.rst:939 msgid "" "Added a *force* keyword argument to :func:`logging.basicConfig()` When set " "to true, any existing handlers attached to the root logger are removed and " @@ -1141,7 +1141,7 @@ msgid "" "arguments." msgstr "" -#: ../../whatsnew/3.8.rst:943 +#: ../../whatsnew/3.8.rst:944 msgid "" "This solves a long-standing problem. Once a logger or *basicConfig()* had " "been called, subsequent calls to *basicConfig()* were silently ignored. This " @@ -1149,53 +1149,53 @@ msgid "" "configuration options using the interactive prompt or a Jupyter notebook." msgstr "" -#: ../../whatsnew/3.8.rst:949 +#: ../../whatsnew/3.8.rst:950 msgid "" "(Suggested by Raymond Hettinger, implemented by Dong-hee Na, and reviewed by " "Vinay Sajip in :issue:`33897`.)" msgstr "" -#: ../../whatsnew/3.8.rst:954 +#: ../../whatsnew/3.8.rst:955 msgid "math" msgstr "math" -#: ../../whatsnew/3.8.rst:956 +#: ../../whatsnew/3.8.rst:957 msgid "" "Added new function :func:`math.dist` for computing Euclidean distance " "between two points. (Contributed by Raymond Hettinger in :issue:`33089`.)" msgstr "" -#: ../../whatsnew/3.8.rst:959 +#: ../../whatsnew/3.8.rst:960 msgid "" "Expanded the :func:`math.hypot` function to handle multiple dimensions. " "Formerly, it only supported the 2-D case. (Contributed by Raymond Hettinger " "in :issue:`33089`.)" msgstr "" -#: ../../whatsnew/3.8.rst:963 +#: ../../whatsnew/3.8.rst:964 msgid "" "Added new function, :func:`math.prod`, as analogous function to :func:`sum` " "that returns the product of a 'start' value (default: 1) times an iterable " "of numbers::" msgstr "" -#: ../../whatsnew/3.8.rst:972 +#: ../../whatsnew/3.8.rst:973 msgid "(Contributed by Pablo Galindo in :issue:`35606`.)" msgstr "" -#: ../../whatsnew/3.8.rst:974 +#: ../../whatsnew/3.8.rst:975 msgid "" "Added two new combinatoric functions :func:`math.perm` and :func:`math." "comb`::" msgstr "" -#: ../../whatsnew/3.8.rst:981 +#: ../../whatsnew/3.8.rst:982 msgid "" "(Contributed by Yash Aggarwal, Keller Fuchs, Serhiy Storchaka, and Raymond " "Hettinger in :issue:`37128`, :issue:`37178`, and :issue:`35431`.)" msgstr "" -#: ../../whatsnew/3.8.rst:984 +#: ../../whatsnew/3.8.rst:985 msgid "" "Added a new function :func:`math.isqrt` for computing accurate integer " "square roots without conversion to floating point. The new function " @@ -1203,48 +1203,48 @@ msgid "" "but slower than :func:`math.sqrt`::" msgstr "" -#: ../../whatsnew/3.8.rst:996 +#: ../../whatsnew/3.8.rst:997 msgid "(Contributed by Mark Dickinson in :issue:`36887`.)" msgstr "" -#: ../../whatsnew/3.8.rst:998 +#: ../../whatsnew/3.8.rst:999 msgid "" "The function :func:`math.factorial` no longer accepts arguments that are not " "int-like. (Contributed by Pablo Galindo in :issue:`33083`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1003 +#: ../../whatsnew/3.8.rst:1004 msgid "mmap" msgstr "mmap" -#: ../../whatsnew/3.8.rst:1005 +#: ../../whatsnew/3.8.rst:1006 msgid "" "The :class:`mmap.mmap` class now has an :meth:`~mmap.mmap.madvise` method to " "access the ``madvise()`` system call. (Contributed by Zackery Spytz in :" "issue:`32941`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1011 +#: ../../whatsnew/3.8.rst:1012 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.8.rst:1013 +#: ../../whatsnew/3.8.rst:1014 msgid "" "Added new :mod:`multiprocessing.shared_memory` module. (Contributed by Davin " "Potts in :issue:`35813`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1016 +#: ../../whatsnew/3.8.rst:1017 msgid "" "On macOS, the *spawn* start method is now used by default. (Contributed by " "Victor Stinner in :issue:`33725`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1021 +#: ../../whatsnew/3.8.rst:1022 msgid "os" msgstr "os" -#: ../../whatsnew/3.8.rst:1023 +#: ../../whatsnew/3.8.rst:1024 msgid "" "Added new function :func:`~os.add_dll_directory` on Windows for providing " "additional search paths for native dependencies when importing extension " @@ -1252,14 +1252,14 @@ msgid "" "issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1028 +#: ../../whatsnew/3.8.rst:1029 msgid "" "A new :func:`os.memfd_create` function was added to wrap the " "``memfd_create()`` syscall. (Contributed by Zackery Spytz and Christian " "Heimes in :issue:`26836`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1032 +#: ../../whatsnew/3.8.rst:1033 msgid "" "On Windows, much of the manual logic for handling reparse points (including " "symlinks and directory junctions) has been delegated to the operating " @@ -1272,7 +1272,7 @@ msgid "" "st_reparse_tag` attribute." msgstr "" -#: ../../whatsnew/3.8.rst:1041 +#: ../../whatsnew/3.8.rst:1042 msgid "" "On Windows, :func:`os.readlink` is now able to read directory junctions. " "Note that :func:`~os.path.islink` will return ``False`` for directory " @@ -1281,15 +1281,15 @@ msgid "" "readlink` may now treat junctions as links." msgstr "" -#: ../../whatsnew/3.8.rst:1047 ../../whatsnew/3.8.rst:1072 +#: ../../whatsnew/3.8.rst:1048 ../../whatsnew/3.8.rst:1073 msgid "(Contributed by Steve Dower in :issue:`37834`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1051 +#: ../../whatsnew/3.8.rst:1052 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.8.rst:1053 +#: ../../whatsnew/3.8.rst:1054 msgid "" ":mod:`os.path` functions that return a boolean result like :func:`~os.path." "exists`, :func:`~os.path.lexists`, :func:`~os.path.isdir`, :func:`~os.path." @@ -1300,7 +1300,7 @@ msgid "" "Storchaka in :issue:`33721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1061 ../../whatsnew/3.8.rst:1961 +#: ../../whatsnew/3.8.rst:1062 ../../whatsnew/3.8.rst:1962 msgid "" ":func:`~os.path.expanduser` on Windows now prefers the :envvar:`USERPROFILE` " "environment variable and does not use :envvar:`HOME`, which is not normally " @@ -1308,23 +1308,23 @@ msgid "" "`36264`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1066 +#: ../../whatsnew/3.8.rst:1067 msgid "" ":func:`~os.path.isdir` on Windows no longer returns ``True`` for a link to a " "non-existent directory." msgstr "" -#: ../../whatsnew/3.8.rst:1069 +#: ../../whatsnew/3.8.rst:1070 msgid "" ":func:`~os.path.realpath` on Windows now resolves reparse points, including " "symlinks and directory junctions." msgstr "" -#: ../../whatsnew/3.8.rst:1076 +#: ../../whatsnew/3.8.rst:1077 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.8.rst:1078 +#: ../../whatsnew/3.8.rst:1079 msgid "" ":mod:`pathlib.Path` methods that return a boolean result like :meth:" "`~pathlib.Path.exists()`, :meth:`~pathlib.Path.is_dir()`, :meth:`~pathlib." @@ -1337,17 +1337,17 @@ msgid "" "`33721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1088 +#: ../../whatsnew/3.8.rst:1089 msgid "" "Added :meth:`pathlib.Path.link_to()` which creates a hard link pointing to a " "path. (Contributed by Joannah Nanjekye in :issue:`26978`)" msgstr "" -#: ../../whatsnew/3.8.rst:1094 +#: ../../whatsnew/3.8.rst:1095 msgid "pickle" msgstr "pickle" -#: ../../whatsnew/3.8.rst:1096 +#: ../../whatsnew/3.8.rst:1097 msgid "" ":mod:`pickle` extensions subclassing the C-optimized :class:`~pickle." "Pickler` can now override the pickling logic of functions and classes by " @@ -1355,22 +1355,22 @@ msgid "" "(Contributed by Pierre Glaser and Olivier Grisel in :issue:`35900`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1103 +#: ../../whatsnew/3.8.rst:1104 msgid "plistlib" msgstr "plistlib" -#: ../../whatsnew/3.8.rst:1105 +#: ../../whatsnew/3.8.rst:1106 msgid "" "Added new :class:`plistlib.UID` and enabled support for reading and writing " "NSKeyedArchiver-encoded binary plists. (Contributed by Jon Janzen in :issue:" "`26707`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1111 +#: ../../whatsnew/3.8.rst:1112 msgid "pprint" msgstr "pprint" -#: ../../whatsnew/3.8.rst:1113 +#: ../../whatsnew/3.8.rst:1114 msgid "" "The :mod:`pprint` module added a *sort_dicts* parameter to several " "functions. By default, those functions continue to sort dictionaries before " @@ -1379,47 +1379,47 @@ msgid "" "for comparison to JSON inputs during debugging." msgstr "" -#: ../../whatsnew/3.8.rst:1119 +#: ../../whatsnew/3.8.rst:1120 msgid "" "In addition, there is a convenience new function, :func:`pprint.pp` that is " "like :func:`pprint.pprint` but with *sort_dicts* defaulting to ``False``::" msgstr "" -#: ../../whatsnew/3.8.rst:1133 +#: ../../whatsnew/3.8.rst:1134 msgid "(Contributed by Rémi Lapeyre in :issue:`30670`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1137 +#: ../../whatsnew/3.8.rst:1138 msgid "py_compile" msgstr "py_compile" -#: ../../whatsnew/3.8.rst:1139 +#: ../../whatsnew/3.8.rst:1140 msgid "" ":func:`py_compile.compile` now supports silent mode. (Contributed by Joannah " "Nanjekye in :issue:`22640`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1144 +#: ../../whatsnew/3.8.rst:1145 msgid "shlex" msgstr "shlex" -#: ../../whatsnew/3.8.rst:1146 +#: ../../whatsnew/3.8.rst:1147 msgid "" "The new :func:`shlex.join` function acts as the inverse of :func:`shlex." "split`. (Contributed by Bo Bayles in :issue:`32102`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1151 +#: ../../whatsnew/3.8.rst:1152 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.8.rst:1153 +#: ../../whatsnew/3.8.rst:1154 msgid "" ":func:`shutil.copytree` now accepts a new ``dirs_exist_ok`` keyword " "argument. (Contributed by Josh Bronson in :issue:`20849`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1156 +#: ../../whatsnew/3.8.rst:1157 msgid "" ":func:`shutil.make_archive` now defaults to the modern pax (POSIX.1-2001) " "format for new archives to improve portability and standards conformance, " @@ -1427,18 +1427,18 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`30661`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1161 +#: ../../whatsnew/3.8.rst:1162 msgid "" ":func:`shutil.rmtree` on Windows now removes directory junctions without " "recursively removing their contents first. (Contributed by Steve Dower in :" "issue:`37834`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1167 +#: ../../whatsnew/3.8.rst:1168 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.8.rst:1169 +#: ../../whatsnew/3.8.rst:1170 msgid "" "Added :meth:`~socket.create_server()` and :meth:`~socket." "has_dualstack_ipv6()` convenience functions to automate the necessary tasks " @@ -1447,66 +1447,66 @@ msgid "" "Rodolà in :issue:`17561`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1174 +#: ../../whatsnew/3.8.rst:1175 msgid "" "The :func:`socket.if_nameindex()`, :func:`socket.if_nametoindex()`, and :" "func:`socket.if_indextoname()` functions have been implemented on Windows. " "(Contributed by Zackery Spytz in :issue:`37007`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1180 +#: ../../whatsnew/3.8.rst:1181 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.8.rst:1182 +#: ../../whatsnew/3.8.rst:1183 msgid "" "Added :attr:`~ssl.SSLContext.post_handshake_auth` to enable and :meth:`~ssl." "SSLSocket.verify_client_post_handshake` to initiate TLS 1.3 post-handshake " "authentication. (Contributed by Christian Heimes in :issue:`34670`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1189 +#: ../../whatsnew/3.8.rst:1190 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.8.rst:1191 +#: ../../whatsnew/3.8.rst:1192 msgid "" "Added :func:`statistics.fmean` as a faster, floating point variant of :func:" "`statistics.mean()`. (Contributed by Raymond Hettinger and Steven D'Aprano " "in :issue:`35904`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1195 +#: ../../whatsnew/3.8.rst:1196 msgid "" "Added :func:`statistics.geometric_mean()` (Contributed by Raymond Hettinger " "in :issue:`27181`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1198 +#: ../../whatsnew/3.8.rst:1199 msgid "" "Added :func:`statistics.multimode` that returns a list of the most common " "values. (Contributed by Raymond Hettinger in :issue:`35892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1201 +#: ../../whatsnew/3.8.rst:1202 msgid "" "Added :func:`statistics.quantiles` that divides data or a distribution in to " "equiprobable intervals (e.g. quartiles, deciles, or percentiles). " "(Contributed by Raymond Hettinger in :issue:`36546`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1205 +#: ../../whatsnew/3.8.rst:1206 msgid "" "Added :class:`statistics.NormalDist`, a tool for creating and manipulating " "normal distributions of a random variable. (Contributed by Raymond Hettinger " "in :issue:`36018`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1235 +#: ../../whatsnew/3.8.rst:1236 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.8.rst:1237 +#: ../../whatsnew/3.8.rst:1238 msgid "" "Add new :func:`sys.unraisablehook` function which can be overridden to " "control how \"unraisable exceptions\" are handled. It is called when an " @@ -1515,11 +1515,11 @@ msgid "" "(:func:`gc.collect`). (Contributed by Victor Stinner in :issue:`36829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1246 +#: ../../whatsnew/3.8.rst:1247 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.8.rst:1248 +#: ../../whatsnew/3.8.rst:1249 msgid "" "The :mod:`tarfile` module now defaults to the modern pax (POSIX.1-2001) " "format for new archives, instead of the previous GNU-specific one. This " @@ -1528,11 +1528,11 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`36268`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1256 +#: ../../whatsnew/3.8.rst:1257 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.8.rst:1258 +#: ../../whatsnew/3.8.rst:1259 msgid "" "Add a new :func:`threading.excepthook` function which handles uncaught :meth:" "`threading.Thread.run` exception. It can be overridden to control how " @@ -1540,7 +1540,7 @@ msgid "" "by Victor Stinner in :issue:`1230540`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1263 +#: ../../whatsnew/3.8.rst:1264 msgid "" "Add a new :func:`threading.get_native_id` function and a :data:`~threading." "Thread.native_id` attribute to the :class:`threading.Thread` class. These " @@ -1550,11 +1550,11 @@ msgid "" "by Jake Tesler in :issue:`36084`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1273 +#: ../../whatsnew/3.8.rst:1274 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.8.rst:1275 +#: ../../whatsnew/3.8.rst:1276 msgid "" "The :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token when " "provided with input that does not have a trailing new line. This behavior " @@ -1562,11 +1562,11 @@ msgid "" "Askar in :issue:`33899`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1282 +#: ../../whatsnew/3.8.rst:1283 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.8.rst:1284 +#: ../../whatsnew/3.8.rst:1285 msgid "" "Added methods :meth:`~tkinter.Spinbox.selection_from`, :meth:`~tkinter." "Spinbox.selection_present`, :meth:`~tkinter.Spinbox.selection_range` and :" @@ -1574,38 +1574,38 @@ msgid "" "(Contributed by Juliette Monsel in :issue:`34829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1291 +#: ../../whatsnew/3.8.rst:1292 msgid "" "Added method :meth:`~tkinter.Canvas.moveto` in the :class:`tkinter.Canvas` " "class. (Contributed by Juliette Monsel in :issue:`23831`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1295 +#: ../../whatsnew/3.8.rst:1296 msgid "" "The :class:`tkinter.PhotoImage` class now has :meth:`~tkinter.PhotoImage." "transparency_get` and :meth:`~tkinter.PhotoImage.transparency_set` methods. " "(Contributed by Zackery Spytz in :issue:`25451`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1302 +#: ../../whatsnew/3.8.rst:1303 msgid "time" msgstr "time" -#: ../../whatsnew/3.8.rst:1304 +#: ../../whatsnew/3.8.rst:1305 msgid "" "Added new clock :data:`~time.CLOCK_UPTIME_RAW` for macOS 10.12. (Contributed " "by Joannah Nanjekye in :issue:`35702`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1309 +#: ../../whatsnew/3.8.rst:1310 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.8.rst:1311 +#: ../../whatsnew/3.8.rst:1312 msgid "The :mod:`typing` module incorporates several new features:" msgstr "" -#: ../../whatsnew/3.8.rst:1313 +#: ../../whatsnew/3.8.rst:1314 msgid "" "A dictionary type with per-key types. See :pep:`589` and :class:`typing." "TypedDict`. TypedDict uses only string keys. By default, every key is " @@ -1613,46 +1613,46 @@ msgid "" "optional::" msgstr "" -#: ../../whatsnew/3.8.rst:1323 +#: ../../whatsnew/3.8.rst:1324 msgid "" "Literal types. See :pep:`586` and :class:`typing.Literal`. Literal types " "indicate that a parameter or return value is constrained to one or more " "specific literal values::" msgstr "" -#: ../../whatsnew/3.8.rst:1330 +#: ../../whatsnew/3.8.rst:1331 msgid "" "\"Final\" variables, functions, methods and classes. See :pep:`591`, :class:" "`typing.Final` and :func:`typing.final`. The final qualifier instructs a " "static type checker to restrict subclassing, overriding, or reassignment::" msgstr "" -#: ../../whatsnew/3.8.rst:1337 +#: ../../whatsnew/3.8.rst:1338 msgid "" "Protocol definitions. See :pep:`544`, :class:`typing.Protocol` and :func:" "`typing.runtime_checkable`. Simple ABCs like :class:`typing.SupportsInt` " "are now ``Protocol`` subclasses." msgstr "" -#: ../../whatsnew/3.8.rst:1341 +#: ../../whatsnew/3.8.rst:1342 msgid "New protocol class :class:`typing.SupportsIndex`." msgstr "" -#: ../../whatsnew/3.8.rst:1343 +#: ../../whatsnew/3.8.rst:1344 msgid "New functions :func:`typing.get_origin` and :func:`typing.get_args`." msgstr "" -#: ../../whatsnew/3.8.rst:1347 +#: ../../whatsnew/3.8.rst:1348 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.8.rst:1349 +#: ../../whatsnew/3.8.rst:1350 msgid "" "The :mod:`unicodedata` module has been upgraded to use the `Unicode 12.1.0 " "`_ release." msgstr "" -#: ../../whatsnew/3.8.rst:1352 +#: ../../whatsnew/3.8.rst:1353 msgid "" "New function :func:`~unicodedata.is_normalized` can be used to verify a " "string is in a specific normal form, often much faster than by actually " @@ -1660,11 +1660,11 @@ msgid "" "Greg Price in :issue:`32285` and :issue:`37966`)." msgstr "" -#: ../../whatsnew/3.8.rst:1359 +#: ../../whatsnew/3.8.rst:1360 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.8.rst:1361 +#: ../../whatsnew/3.8.rst:1362 msgid "" "Added :class:`~unittest.mock.AsyncMock` to support an asynchronous version " "of :class:`~unittest.mock.Mock`. Appropriate new assert functions for " @@ -1672,7 +1672,7 @@ msgid "" "`26467`)." msgstr "" -#: ../../whatsnew/3.8.rst:1366 +#: ../../whatsnew/3.8.rst:1367 msgid "" "Added :func:`~unittest.addModuleCleanup()` and :meth:`~unittest.TestCase." "addClassCleanup()` to unittest to support cleanups for :func:`~unittest." @@ -1680,60 +1680,60 @@ msgid "" "Lisa Roach in :issue:`24412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1372 +#: ../../whatsnew/3.8.rst:1373 msgid "" "Several mock assert functions now also print a list of actual calls upon " "failure. (Contributed by Petter Strandmark in :issue:`35047`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1375 +#: ../../whatsnew/3.8.rst:1376 msgid "" ":mod:`unittest` module gained support for coroutines to be used as test " "cases with :class:`unittest.IsolatedAsyncioTestCase`. (Contributed by Andrew " "Svetlov in :issue:`32972`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1379 +#: ../../whatsnew/3.8.rst:1380 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../whatsnew/3.8.rst:1402 +#: ../../whatsnew/3.8.rst:1403 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.8.rst:1404 +#: ../../whatsnew/3.8.rst:1405 msgid "" ":mod:`venv` now includes an ``Activate.ps1`` script on all platforms for " "activating virtual environments under PowerShell Core 6.1. (Contributed by " "Brett Cannon in :issue:`32718`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1410 +#: ../../whatsnew/3.8.rst:1411 msgid "weakref" msgstr "weakref" -#: ../../whatsnew/3.8.rst:1412 +#: ../../whatsnew/3.8.rst:1413 msgid "" "The proxy objects returned by :func:`weakref.proxy` now support the matrix " "multiplication operators ``@`` and ``@=`` in addition to the other numeric " "operators. (Contributed by Mark Dickinson in :issue:`36669`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1418 +#: ../../whatsnew/3.8.rst:1419 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.8.rst:1420 +#: ../../whatsnew/3.8.rst:1421 msgid "" "As mitigation against DTD and external entity retrieval, the :mod:`xml.dom." "minidom` and :mod:`xml.sax` modules no longer process external entities by " "default. (Contributed by Christian Heimes in :issue:`17239`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1425 +#: ../../whatsnew/3.8.rst:1426 msgid "" "The ``.find*()`` methods in the :mod:`xml.etree.ElementTree` module support " "wildcard searches like ``{*}tag`` which ignores the namespace and " @@ -1741,14 +1741,14 @@ msgid "" "by Stefan Behnel in :issue:`28238`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1430 +#: ../../whatsnew/3.8.rst:1431 msgid "" "The :mod:`xml.etree.ElementTree` module provides a new function :func:`–xml." "etree.ElementTree.canonicalize()` that implements C14N 2.0. (Contributed by " "Stefan Behnel in :issue:`13611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1434 +#: ../../whatsnew/3.8.rst:1435 msgid "" "The target object of :class:`xml.etree.ElementTree.XMLParser` can receive " "namespace declaration events through the new callback methods ``start_ns()`` " @@ -1758,11 +1758,11 @@ msgid "" "by Stefan Behnel in :issue:`36676` and :issue:`36673`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1444 +#: ../../whatsnew/3.8.rst:1445 msgid "xmlrpc" msgstr "xmlrpc" -#: ../../whatsnew/3.8.rst:1446 +#: ../../whatsnew/3.8.rst:1447 msgid "" ":class:`xmlrpc.client.ServerProxy` now supports an optional *headers* " "keyword argument for a sequence of HTTP headers to be sent with each " @@ -1771,36 +1771,36 @@ msgid "" "Cédric Krier in :issue:`35153`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1454 +#: ../../whatsnew/3.8.rst:1455 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.8.rst:1456 +#: ../../whatsnew/3.8.rst:1457 msgid "" "The :mod:`subprocess` module can now use the :func:`os.posix_spawn` function " "in some cases for better performance. Currently, it is only used on macOS " "and Linux (using glibc 2.24 or newer) if all these conditions are met:" msgstr "" -#: ../../whatsnew/3.8.rst:1460 +#: ../../whatsnew/3.8.rst:1461 msgid "*close_fds* is false;" msgstr "" -#: ../../whatsnew/3.8.rst:1461 +#: ../../whatsnew/3.8.rst:1462 msgid "" "*preexec_fn*, *pass_fds*, *cwd* and *start_new_session* parameters are not " "set;" msgstr "" -#: ../../whatsnew/3.8.rst:1463 +#: ../../whatsnew/3.8.rst:1464 msgid "the *executable* path contains a directory." msgstr "" -#: ../../whatsnew/3.8.rst:1465 +#: ../../whatsnew/3.8.rst:1466 msgid "(Contributed by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1467 +#: ../../whatsnew/3.8.rst:1468 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" @@ -1816,7 +1816,7 @@ msgid "" "Rodolà in :issue:`33671`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1483 +#: ../../whatsnew/3.8.rst:1484 msgid "" ":func:`shutil.copytree` uses :func:`os.scandir` function and all copy " "functions depending from it use cached :func:`os.stat` values. The speedup " @@ -1826,27 +1826,27 @@ msgid "" "on network filesystems. (Contributed by Giampaolo Rodolà in :issue:`33695`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1490 +#: ../../whatsnew/3.8.rst:1491 msgid "" "The default protocol in the :mod:`pickle` module is now Protocol 4, first " "introduced in Python 3.4. It offers better performance and smaller size " "compared to Protocol 3 available since Python 3.0." msgstr "" -#: ../../whatsnew/3.8.rst:1494 +#: ../../whatsnew/3.8.rst:1495 msgid "" "Removed one :c:type:`Py_ssize_t` member from ``PyGC_Head``. All GC tracked " "objects (e.g. tuple, list, dict) size is reduced 4 or 8 bytes. (Contributed " "by Inada Naoki in :issue:`33597`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1498 +#: ../../whatsnew/3.8.rst:1499 msgid "" ":class:`uuid.UUID` now uses ``__slots__`` to reduce its memory footprint. " "(Contributed by Wouter Bolsterlee and Tal Einat in :issue:`30977`)" msgstr "" -#: ../../whatsnew/3.8.rst:1501 +#: ../../whatsnew/3.8.rst:1502 msgid "" "Improved performance of :func:`operator.itemgetter` by 33%. Optimized " "argument handling and added a fast path for the common case of a single non-" @@ -1854,7 +1854,7 @@ msgid "" "standard library). (Contributed by Raymond Hettinger in :issue:`35664`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1507 +#: ../../whatsnew/3.8.rst:1508 msgid "" "Sped-up field lookups in :func:`collections.namedtuple`. They are now more " "than two times faster, making them the fastest form of instance variable " @@ -1862,7 +1862,7 @@ msgid "" "Jevnik, Serhiy Storchaka in :issue:`32492`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1512 +#: ../../whatsnew/3.8.rst:1513 msgid "" "The :class:`list` constructor does not overallocate the internal item buffer " "if the input iterable has a known length (the input implements ``__len__``). " @@ -1870,7 +1870,7 @@ msgid "" "Hettinger and Pablo Galindo in :issue:`33234`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1517 +#: ../../whatsnew/3.8.rst:1518 msgid "" "Doubled the speed of class variable writes. When a non-dunder attribute was " "updated, there was an unnecessary call to update slots. (Contributed by " @@ -1878,7 +1878,7 @@ msgid "" "and Serhiy Storchaka in :issue:`36012`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1522 +#: ../../whatsnew/3.8.rst:1523 msgid "" "Reduced an overhead of converting arguments passed to many builtin functions " "and methods. This sped up calling some simple builtin functions and methods " @@ -1886,18 +1886,18 @@ msgid "" "`35582` and :issue:`36127`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1527 +#: ../../whatsnew/3.8.rst:1528 msgid "" "``LOAD_GLOBAL`` instruction now uses new \"per opcode cache\" mechanism. It " "is about 40% faster now. (Contributed by Yury Selivanov and Inada Naoki in :" "issue:`26219`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1533 +#: ../../whatsnew/3.8.rst:1534 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.8.rst:1535 +#: ../../whatsnew/3.8.rst:1536 msgid "" "Default :data:`sys.abiflags` became an empty string: the ``m`` flag for " "pymalloc became useless (builds with and without pymalloc are ABI " @@ -1905,22 +1905,22 @@ msgid "" "issue:`36707`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1539 +#: ../../whatsnew/3.8.rst:1540 msgid "Example of changes:" msgstr "" -#: ../../whatsnew/3.8.rst:1541 +#: ../../whatsnew/3.8.rst:1542 msgid "" "Only ``python3.8`` program is installed, ``python3.8m`` program is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1542 +#: ../../whatsnew/3.8.rst:1543 msgid "" "Only ``python3.8-config`` script is installed, ``python3.8m-config`` script " "is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1544 +#: ../../whatsnew/3.8.rst:1545 msgid "" "The ``m`` flag has been removed from the suffix of dynamic library " "filenames: extension modules in the standard library as well as those " @@ -1929,23 +1929,23 @@ msgid "" "linux-gnu.so`` became ``.cpython-38-x86_64-linux-gnu.so`` in Python 3.8." msgstr "" -#: ../../whatsnew/3.8.rst:1551 +#: ../../whatsnew/3.8.rst:1552 msgid "" "The header files have been reorganized to better separate the different " "kinds of APIs:" msgstr "" -#: ../../whatsnew/3.8.rst:1554 +#: ../../whatsnew/3.8.rst:1555 msgid "``Include/*.h`` should be the portable public stable C API." msgstr "" -#: ../../whatsnew/3.8.rst:1555 +#: ../../whatsnew/3.8.rst:1556 msgid "" "``Include/cpython/*.h`` should be the unstable C API specific to CPython; " "public API, with some private API prefixed by ``_Py`` or ``_PY``." msgstr "" -#: ../../whatsnew/3.8.rst:1557 +#: ../../whatsnew/3.8.rst:1558 msgid "" "``Include/internal/*.h`` is the private internal C API very specific to " "CPython. This API comes with no backward compatibility warranty and should " @@ -1954,42 +1954,42 @@ msgid "" "calling functions. This API is now installed by ``make install``." msgstr "" -#: ../../whatsnew/3.8.rst:1563 +#: ../../whatsnew/3.8.rst:1564 msgid "" "(Contributed by Victor Stinner in :issue:`35134` and :issue:`35081`, work " "initiated by Eric Snow in Python 3.7.)" msgstr "" -#: ../../whatsnew/3.8.rst:1566 +#: ../../whatsnew/3.8.rst:1567 msgid "" "Some macros have been converted to static inline functions: parameter types " "and return type are well defined, they don't have issues specific to macros, " "variables have a local scopes. Examples:" msgstr "" -#: ../../whatsnew/3.8.rst:1570 +#: ../../whatsnew/3.8.rst:1571 msgid ":c:func:`Py_INCREF`, :c:func:`Py_DECREF`" msgstr ":c:func:`Py_INCREF`, :c:func:`Py_DECREF`" -#: ../../whatsnew/3.8.rst:1571 +#: ../../whatsnew/3.8.rst:1572 msgid ":c:func:`Py_XINCREF`, :c:func:`Py_XDECREF`" msgstr ":c:func:`Py_XINCREF`, :c:func:`Py_XDECREF`" -#: ../../whatsnew/3.8.rst:1572 +#: ../../whatsnew/3.8.rst:1573 msgid ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" msgstr ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" -#: ../../whatsnew/3.8.rst:1573 +#: ../../whatsnew/3.8.rst:1574 msgid "" "Private functions: :c:func:`_PyObject_GC_TRACK`, :c:func:" "`_PyObject_GC_UNTRACK`, :c:func:`_Py_Dealloc`" msgstr "" -#: ../../whatsnew/3.8.rst:1576 +#: ../../whatsnew/3.8.rst:1577 msgid "(Contributed by Victor Stinner in :issue:`35059`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1578 +#: ../../whatsnew/3.8.rst:1579 msgid "" "The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini` functions have " "been removed. They did nothing since Python 2.7.4 and Python 3.2.0, were " @@ -1997,14 +1997,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`35713`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1583 +#: ../../whatsnew/3.8.rst:1584 msgid "" "The result of :c:func:`PyExceptionClass_Name` is now of type ``const char " "*`` rather of ``char *``. (Contributed by Serhiy Storchaka in :issue:" "`33818`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1587 +#: ../../whatsnew/3.8.rst:1588 msgid "" "The duality of ``Modules/Setup.dist`` and ``Modules/Setup`` has been " "removed. Previously, when updating the CPython source tree, one had to " @@ -2015,7 +2015,7 @@ msgid "" "the file could produce build failures." msgstr "" -#: ../../whatsnew/3.8.rst:1595 +#: ../../whatsnew/3.8.rst:1596 msgid "" "Now the build system always reads from ``Modules/Setup`` inside the source " "tree. People who want to customize that file are encouraged to maintain " @@ -2023,11 +2023,11 @@ msgid "" "for any other change to the source tree." msgstr "" -#: ../../whatsnew/3.8.rst:1600 +#: ../../whatsnew/3.8.rst:1601 msgid "(Contributed by Antoine Pitrou in :issue:`32430`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1602 +#: ../../whatsnew/3.8.rst:1603 msgid "" "Functions that convert Python number to C integer like :c:func:" "`PyLong_AsLong` and argument parsing functions like :c:func:" @@ -2043,7 +2043,7 @@ msgid "" "`20092`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1616 +#: ../../whatsnew/3.8.rst:1617 msgid "" "Heap-allocated type objects will now increase their reference count in :c:" "func:`PyObject_Init` (and its parallel macro ``PyObject_INIT``) instead of " @@ -2052,7 +2052,7 @@ msgid "" "issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1622 +#: ../../whatsnew/3.8.rst:1623 msgid "" "The new function :c:func:`PyCode_NewWithPosOnlyArgs` allows to create code " "objects like :c:func:`PyCode_New`, but with an extra *posonlyargcount* " @@ -2060,25 +2060,25 @@ msgid "" "(Contributed by Pablo Galindo in :issue:`37221`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1627 +#: ../../whatsnew/3.8.rst:1628 msgid "" ":c:func:`Py_SetPath` now sets :data:`sys.executable` to the program full " "path (:c:func:`Py_GetProgramFullPath`) rather than to the program name (:c:" "func:`Py_GetProgramName`). (Contributed by Victor Stinner in :issue:`38234`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1634 +#: ../../whatsnew/3.8.rst:1635 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.8.rst:1636 +#: ../../whatsnew/3.8.rst:1637 msgid "" "The distutils ``bdist_wininst`` command is now deprecated, use " "``bdist_wheel`` (wheel packages) instead. (Contributed by Victor Stinner in :" "issue:`37481`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1640 +#: ../../whatsnew/3.8.rst:1641 msgid "" "Deprecated methods ``getchildren()`` and ``getiterator()`` in the :mod:`~xml." "etree.ElementTree` module now emit a :exc:`DeprecationWarning` instead of :" @@ -2086,7 +2086,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1646 +#: ../../whatsnew/3.8.rst:1647 msgid "" "Passing an object that is not an instance of :class:`concurrent.futures." "ThreadPoolExecutor` to :meth:`loop.set_default_executor() `. (Contributed by Serhiy Storchaka in :issue:`36492`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1747 +#: ../../whatsnew/3.8.rst:1748 msgid "API and Feature Removals" msgstr "" -#: ../../whatsnew/3.8.rst:1749 +#: ../../whatsnew/3.8.rst:1750 msgid "The following features and APIs have been removed from Python 3.8:" msgstr "" -#: ../../whatsnew/3.8.rst:1751 +#: ../../whatsnew/3.8.rst:1752 msgid "" "Starting with Python 3.3, importing ABCs from :mod:`collections` was " "deprecated, and importing should be done from :mod:`collections.abc`. Being " @@ -2257,20 +2257,20 @@ msgid "" "delayed to 3.9. (See :issue:`36952`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1756 +#: ../../whatsnew/3.8.rst:1757 msgid "" "The :mod:`macpath` module, deprecated in Python 3.7, has been removed. " "(Contributed by Victor Stinner in :issue:`35471`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1759 ../../whatsnew/3.8.rst:1878 +#: ../../whatsnew/3.8.rst:1760 ../../whatsnew/3.8.rst:1879 msgid "" "The function :func:`platform.popen` has been removed, after having been " "deprecated since Python 3.3: use :func:`os.popen` instead. (Contributed by " "Victor Stinner in :issue:`35345`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1763 +#: ../../whatsnew/3.8.rst:1764 msgid "" "The function :func:`time.clock` has been removed, after having been " "deprecated since Python 3.3: use :func:`time.perf_counter` or :func:`time." @@ -2278,27 +2278,27 @@ msgid "" "behavior. (Contributed by Matthias Bussonnier in :issue:`36895`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1769 +#: ../../whatsnew/3.8.rst:1770 msgid "" "The ``pyvenv`` script has been removed in favor of ``python3.8 -m venv`` to " "help eliminate confusion as to what Python interpreter the ``pyvenv`` script " "is tied to. (Contributed by Brett Cannon in :issue:`25427`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1773 +#: ../../whatsnew/3.8.rst:1774 msgid "" "``parse_qs``, ``parse_qsl``, and ``escape`` are removed from the :mod:`cgi` " "module. They are deprecated in Python 3.2 or older. They should be imported " "from the ``urllib.parse`` and ``html`` modules instead." msgstr "" -#: ../../whatsnew/3.8.rst:1777 +#: ../../whatsnew/3.8.rst:1778 msgid "" "``filemode`` function is removed from the :mod:`tarfile` module. It is not " "documented and deprecated since Python 3.3." msgstr "" -#: ../../whatsnew/3.8.rst:1780 +#: ../../whatsnew/3.8.rst:1781 msgid "" "The :class:`~xml.etree.ElementTree.XMLParser` constructor no longer accepts " "the *html* argument. It never had an effect and was deprecated in Python " @@ -2306,53 +2306,53 @@ msgid "" "only_parameter>`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1785 +#: ../../whatsnew/3.8.rst:1786 msgid "" "Removed the ``doctype()`` method of :class:`~xml.etree.ElementTree." "XMLParser`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1788 +#: ../../whatsnew/3.8.rst:1789 msgid "" "\"unicode_internal\" codec is removed. (Contributed by Inada Naoki in :issue:" "`36297`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1791 +#: ../../whatsnew/3.8.rst:1792 msgid "" "The ``Cache`` and ``Statement`` objects of the :mod:`sqlite3` module are not " "exposed to the user. (Contributed by Aviv Palivoda in :issue:`30262`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1795 +#: ../../whatsnew/3.8.rst:1796 msgid "" "The ``bufsize`` keyword argument of :func:`fileinput.input` and :func:" "`fileinput.FileInput` which was ignored and deprecated since Python 3.6 has " "been removed. :issue:`36952` (Contributed by Matthias Bussonnier.)" msgstr "" -#: ../../whatsnew/3.8.rst:1799 +#: ../../whatsnew/3.8.rst:1800 msgid "" "The functions :func:`sys.set_coroutine_wrapper` and :func:`sys." "get_coroutine_wrapper` deprecated in Python 3.7 have been removed; :issue:" "`36933` (Contributed by Matthias Bussonnier.)" msgstr "" -#: ../../whatsnew/3.8.rst:1805 +#: ../../whatsnew/3.8.rst:1806 msgid "Porting to Python 3.8" msgstr "" -#: ../../whatsnew/3.8.rst:1807 +#: ../../whatsnew/3.8.rst:1808 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.8.rst:1812 +#: ../../whatsnew/3.8.rst:1813 msgid "Changes in Python behavior" msgstr "" -#: ../../whatsnew/3.8.rst:1814 +#: ../../whatsnew/3.8.rst:1815 msgid "" "Yield expressions (both ``yield`` and ``yield from`` clauses) are now " "disallowed in comprehensions and generator expressions (aside from the " @@ -2360,7 +2360,7 @@ msgid "" "Serhiy Storchaka in :issue:`10544`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1819 +#: ../../whatsnew/3.8.rst:1820 msgid "" "The compiler now produces a :exc:`SyntaxWarning` when identity checks " "(``is`` and ``is not``) are used with certain types of literals (e.g. " @@ -2370,7 +2370,7 @@ msgid "" "issue:`34850`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1826 +#: ../../whatsnew/3.8.rst:1827 msgid "" "The CPython interpreter can swallow exceptions in some circumstances. In " "Python 3.8 this happens in fewer cases. In particular, exceptions raised " @@ -2378,7 +2378,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`35459`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1831 +#: ../../whatsnew/3.8.rst:1832 msgid "" "Removed ``__str__`` implementations from builtin types :class:`bool`, :class:" "`int`, :class:`float`, :class:`complex` and few classes from the standard " @@ -2388,7 +2388,7 @@ msgid "" "issue:`36793`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1838 +#: ../../whatsnew/3.8.rst:1839 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since older " @@ -2397,7 +2397,7 @@ msgid "" "`36588`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1844 +#: ../../whatsnew/3.8.rst:1845 msgid "" ":c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` now " "terminate the current thread if called while the interpreter is finalizing, " @@ -2408,11 +2408,11 @@ msgid "" "`36475`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1854 +#: ../../whatsnew/3.8.rst:1855 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.8.rst:1856 +#: ../../whatsnew/3.8.rst:1857 msgid "" "The :func:`os.getcwdb` function now uses the UTF-8 encoding on Windows, " "rather than the ANSI code page: see :pep:`529` for the rationale. The " @@ -2420,7 +2420,7 @@ msgid "" "in :issue:`37412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1861 +#: ../../whatsnew/3.8.rst:1862 msgid "" ":class:`subprocess.Popen` can now use :func:`os.posix_spawn` in some cases " "for better performance. On Windows Subsystem for Linux and QEMU User " @@ -2430,7 +2430,7 @@ msgid "" "by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1868 +#: ../../whatsnew/3.8.rst:1869 msgid "" "The *preexec_fn* argument of * :class:`subprocess.Popen` is no longer " "compatible with subinterpreters. The use of the parameter in a " @@ -2438,20 +2438,20 @@ msgid "" "issue:`34651`, modified by Christian Heimes in :issue:`37951`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1874 +#: ../../whatsnew/3.8.rst:1875 msgid "" "The :meth:`imap.IMAP4.logout` method no longer silently ignores arbitrary " "exceptions. (Contributed by Victor Stinner in :issue:`36348`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1882 +#: ../../whatsnew/3.8.rst:1883 msgid "" "The :func:`statistics.mode` function no longer raises an exception when " "given multimodal data. Instead, it returns the first mode encountered in " "the input data. (Contributed by Raymond Hettinger in :issue:`35892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1887 +#: ../../whatsnew/3.8.rst:1888 msgid "" "The :meth:`~tkinter.ttk.Treeview.selection` method of the :class:`tkinter." "ttk.Treeview` class no longer takes arguments. Using it with arguments for " @@ -2460,7 +2460,7 @@ msgid "" "selection. (Contributed by Serhiy Storchaka in :issue:`31508`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1893 +#: ../../whatsnew/3.8.rst:1894 msgid "" "The :meth:`writexml`, :meth:`toxml` and :meth:`toprettyxml` methods of :mod:" "`xml.dom.minidom`, and the :meth:`write` method of :mod:`xml.etree`, now " @@ -2468,14 +2468,14 @@ msgid "" "Rojas and Raymond Hettinger in :issue:`34160`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1898 +#: ../../whatsnew/3.8.rst:1899 msgid "" "A :mod:`dbm.dumb` database opened with flags ``'r'`` is now read-only. :func:" "`dbm.dumb.open` with flags ``'r'`` and ``'w'`` no longer creates a database " "if it does not exist. (Contributed by Serhiy Storchaka in :issue:`32749`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1903 +#: ../../whatsnew/3.8.rst:1904 msgid "" "The ``doctype()`` method defined in a subclass of :class:`~xml.etree." "ElementTree.XMLParser` will no longer be called and will emit a :exc:" @@ -2485,7 +2485,7 @@ msgid "" "in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1910 +#: ../../whatsnew/3.8.rst:1911 msgid "" "A :exc:`RuntimeError` is now raised when the custom metaclass doesn't " "provide the ``__classcell__`` entry in the namespace passed to ``type." @@ -2493,13 +2493,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`23722`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1915 +#: ../../whatsnew/3.8.rst:1916 msgid "" "The :class:`cProfile.Profile` class can now be used as a context manager. " "(Contributed by Scott Sanderson in :issue:`29235`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1918 +#: ../../whatsnew/3.8.rst:1919 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" @@ -2507,19 +2507,19 @@ msgid "" "section)." msgstr "" -#: ../../whatsnew/3.8.rst:1923 +#: ../../whatsnew/3.8.rst:1924 msgid "" ":func:`shutil.copyfile` default buffer size on Windows was changed from 16 " "KiB to 1 MiB." msgstr "" -#: ../../whatsnew/3.8.rst:1926 +#: ../../whatsnew/3.8.rst:1927 msgid "" "The ``PyGC_Head`` struct has changed completely. All code that touched the " "struct member should be rewritten. (See :issue:`33597`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1929 +#: ../../whatsnew/3.8.rst:1930 msgid "" "The :c:type:`PyInterpreterState` struct has been moved into the \"internal\" " "header files (specifically Include/internal/pycore_pystate.h). An opaque " @@ -2531,7 +2531,7 @@ msgid "" "functions to the public API). (See :issue:`35886`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1939 +#: ../../whatsnew/3.8.rst:1940 msgid "" "The :meth:`mmap.flush() ` method now returns ``None`` on " "success and raises an exception on error under all platforms. Previously, " @@ -2541,13 +2541,13 @@ msgid "" "(Contributed by Berker Peksag in :issue:`2122`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1946 +#: ../../whatsnew/3.8.rst:1947 msgid "" ":mod:`xml.dom.minidom` and :mod:`xml.sax` modules no longer process external " "entities by default. (Contributed by Christian Heimes in :issue:`17239`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1950 +#: ../../whatsnew/3.8.rst:1951 msgid "" "Deleting a key from a read-only :mod:`dbm` database (:mod:`dbm.dumb`, :mod:" "`dbm.gnu` or :mod:`dbm.ndbm`) raises :attr:`error` (:exc:`dbm.dumb.error`, :" @@ -2555,7 +2555,7 @@ msgid "" "(Contributed by Xiang Zhang in :issue:`33106`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1955 +#: ../../whatsnew/3.8.rst:1956 msgid "" "Simplified AST for literals. All constants will be represented as :class:" "`ast.Constant` instances. Instantiating old classes ``Num``, ``Str``, " @@ -2563,7 +2563,7 @@ msgid "" "``Constant``. (Contributed by Serhiy Storchaka in :issue:`32892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1971 +#: ../../whatsnew/3.8.rst:1972 msgid "" "The function :func:`asyncio.wait_for` now correctly waits for cancellation " "when using an instance of :class:`asyncio.Task`. Previously, upon reaching " @@ -2571,18 +2571,18 @@ msgid "" "Pranskevichus in :issue:`32751`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1976 +#: ../../whatsnew/3.8.rst:1977 msgid "" "The function :func:`asyncio.BaseTransport.get_extra_info` now returns a safe " "to use socket object when 'socket' is passed to the *name* parameter. " "(Contributed by Yury Selivanov in :issue:`37027`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1980 +#: ../../whatsnew/3.8.rst:1981 msgid ":class:`asyncio.BufferedProtocol` has graduated to the stable API." msgstr "" -#: ../../whatsnew/3.8.rst:1984 +#: ../../whatsnew/3.8.rst:1985 msgid "" "DLL dependencies for extension modules and DLLs loaded with :mod:`ctypes` on " "Windows are now resolved more securely. Only the system paths, the directory " @@ -2597,14 +2597,14 @@ msgid "" "verified by the installer). (Contributed by Steve Dower in :issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1997 +#: ../../whatsnew/3.8.rst:1998 msgid "" "The header files and functions related to pgen have been removed after its " "replacement by a pure Python implementation. (Contributed by Pablo Galindo " "in :issue:`36623`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2001 +#: ../../whatsnew/3.8.rst:2002 msgid "" ":class:`types.CodeType` has a new parameter in the second position of the " "constructor (*posonlyargcount*) to support positional-only arguments defined " @@ -2614,17 +2614,17 @@ msgid "" "code future-proof." msgstr "" -#: ../../whatsnew/3.8.rst:2008 +#: ../../whatsnew/3.8.rst:2009 msgid "" "The parameter ``digestmod`` for :func:`hmac.new` no longer uses the MD5 " "digest by default." msgstr "" -#: ../../whatsnew/3.8.rst:2012 +#: ../../whatsnew/3.8.rst:2013 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.8.rst:2014 +#: ../../whatsnew/3.8.rst:2015 msgid "" "The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version* " "field. It should be initialized to ``PY_MINOR_VERSION``. The field is " @@ -2632,14 +2632,14 @@ msgid "" "in *cf_flags*. (Contributed by Guido van Rossum in :issue:`35766`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2020 +#: ../../whatsnew/3.8.rst:2021 msgid "" "The :c:func:`PyEval_ReInitThreads` function has been removed from the C API. " "It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " "instead. (Contributed by Victor Stinner in :issue:`36728`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2025 +#: ../../whatsnew/3.8.rst:2026 msgid "" "On Unix, C extensions are no longer linked to libpython except on Android " "and Cygwin. When Python is embedded, ``libpython`` must not be loaded with " @@ -2650,7 +2650,7 @@ msgid "" "Stinner in :issue:`21536`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2033 +#: ../../whatsnew/3.8.rst:2034 msgid "" "Use of ``#`` variants of formats in parsing or building value (e.g. :c:func:" "`PyArg_ParseTuple`, :c:func:`Py_BuildValue`, :c:func:" @@ -2659,7 +2659,7 @@ msgid "" "`arg-parsing` for detail. (Contributed by Inada Naoki in :issue:`36381`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2039 +#: ../../whatsnew/3.8.rst:2040 msgid "" "Instances of heap-allocated types (such as those created with :c:func:" "`PyType_FromSpec`) hold a reference to their type object. Increasing the " @@ -2669,11 +2669,11 @@ msgid "" "through :c:func:`PyType_FromSpec` behave like other classes in managed code." msgstr "" -#: ../../whatsnew/3.8.rst:2047 +#: ../../whatsnew/3.8.rst:2048 msgid ":ref:`Statically allocated types ` are not affected." msgstr "" -#: ../../whatsnew/3.8.rst:2049 +#: ../../whatsnew/3.8.rst:2050 msgid "" "For the vast majority of cases, there should be no side effect. However, " "types that manually increase the reference count after allocating an " @@ -2682,12 +2682,12 @@ msgid "" "instance deallocation." msgstr "" -#: ../../whatsnew/3.8.rst:2055 +#: ../../whatsnew/3.8.rst:2056 msgid "" "To correctly port these types into 3.8, please apply the following changes:" msgstr "" -#: ../../whatsnew/3.8.rst:2058 +#: ../../whatsnew/3.8.rst:2059 msgid "" "Remove :c:macro:`Py_INCREF` on the type object after allocating an instance " "- if any. This may happen after calling :c:func:`PyObject_New`, :c:func:" @@ -2696,32 +2696,32 @@ msgid "" "`PyObject_INIT`." msgstr "" -#: ../../whatsnew/3.8.rst:2065 ../../whatsnew/3.8.rst:2084 -#: ../../whatsnew/3.8.rst:2103 +#: ../../whatsnew/3.8.rst:2066 ../../whatsnew/3.8.rst:2085 +#: ../../whatsnew/3.8.rst:2104 msgid "Example:" msgstr "範例:" -#: ../../whatsnew/3.8.rst:2081 +#: ../../whatsnew/3.8.rst:2082 msgid "" "Ensure that all custom ``tp_dealloc`` functions of heap-allocated types " "decrease the type's reference count." msgstr "" -#: ../../whatsnew/3.8.rst:2098 +#: ../../whatsnew/3.8.rst:2099 msgid "(Contributed by Eddie Elizondo in :issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2100 +#: ../../whatsnew/3.8.rst:2101 msgid "" "The :c:macro:`Py_DEPRECATED()` macro has been implemented for MSVC. The " "macro now must be placed before the symbol name." msgstr "" -#: ../../whatsnew/3.8.rst:2109 +#: ../../whatsnew/3.8.rst:2110 msgid "(Contributed by Zackery Spytz in :issue:`33407`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2111 +#: ../../whatsnew/3.8.rst:2112 msgid "" "The interpreter does not pretend to support binary compatibility of " "extension types across feature releases, anymore. A :c:type:`PyTypeObject` " @@ -2731,17 +2731,17 @@ msgid "" "before reading :c:member:`~PyTypeObject.tp_finalize`)." msgstr "" -#: ../../whatsnew/3.8.rst:2118 +#: ../../whatsnew/3.8.rst:2119 msgid "(Contributed by Antoine Pitrou in :issue:`32388`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2120 +#: ../../whatsnew/3.8.rst:2121 msgid "" "The functions :c:func:`PyNode_AddChild` and :c:func:`PyParser_AddToken` now " "accept two additional ``int`` arguments *end_lineno* and *end_col_offset*." msgstr "" -#: ../../whatsnew/3.8.rst:2123 +#: ../../whatsnew/3.8.rst:2124 msgid "" "The :file:`libpython38.a` file to allow MinGW tools to link directly " "against :file:`python38.dll` is no longer included in the regular Windows " @@ -2750,7 +2750,7 @@ msgid "" "package:" msgstr "" -#: ../../whatsnew/3.8.rst:2133 +#: ../../whatsnew/3.8.rst:2134 msgid "" "The location of an installed :file:`pythonXY.dll` will depend on the " "installation options and the version and language of Windows. See :ref:" @@ -2759,15 +2759,15 @@ msgid "" "the :file:`libs` directory under your Python installation." msgstr "" -#: ../../whatsnew/3.8.rst:2139 +#: ../../whatsnew/3.8.rst:2140 msgid "(Contributed by Steve Dower in :issue:`37351`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2143 +#: ../../whatsnew/3.8.rst:2144 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.8.rst:2145 +#: ../../whatsnew/3.8.rst:2146 msgid "" "The interpreter loop has been simplified by moving the logic of unrolling " "the stack of blocks into the compiler. The compiler emits now explicit " @@ -2775,7 +2775,7 @@ msgid "" "code for :keyword:`break`, :keyword:`continue` and :keyword:`return`." msgstr "" -#: ../../whatsnew/3.8.rst:2151 +#: ../../whatsnew/3.8.rst:2152 msgid "" "Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:" "`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes :opcode:" @@ -2784,20 +2784,20 @@ msgid "" "`WITH_CLEANUP_START`." msgstr "" -#: ../../whatsnew/3.8.rst:2157 +#: ../../whatsnew/3.8.rst:2158 msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2160 +#: ../../whatsnew/3.8.rst:2161 msgid "" "Added new opcode :opcode:`END_ASYNC_FOR` for handling exceptions raised when " "awaiting a next item in an :keyword:`async for` loop. (Contributed by Serhiy " "Storchaka in :issue:`33041`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2164 +#: ../../whatsnew/3.8.rst:2165 msgid "" "The :opcode:`MAP_ADD` now expects the value as the first element in the " "stack and the key as the second element. This change was made so the key is " @@ -2805,22 +2805,22 @@ msgid "" "by :pep:`572`. (Contributed by Jörn Heissler in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2171 +#: ../../whatsnew/3.8.rst:2172 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.8.rst:2173 +#: ../../whatsnew/3.8.rst:2174 msgid "" "Added a benchmark script for timing various ways to access variables: " "``Tools/scripts/var_access_benchmark.py``. (Contributed by Raymond Hettinger " "in :issue:`35884`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2177 +#: ../../whatsnew/3.8.rst:2178 msgid "Here's a summary of performance improvements since Python 3.3:" msgstr "" -#: ../../whatsnew/3.8.rst:2224 +#: ../../whatsnew/3.8.rst:2225 msgid "" "The benchmarks were measured on an `Intel® Core™ i7-4960HQ processor " " pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy