diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 924f76c036..fc315f9677 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.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-05-30 00:18+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -94,8 +94,8 @@ msgstr "I" msgid " :c:member:`~PyTypeObject.tp_name`" msgstr " :c:member:`~PyTypeObject.tp_name`" -#: ../../c-api/typeobj.rst:44 ../../c-api/typeobj.rst:86 -#: ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:44 +#: ../../c-api/typeobj.rst:86 msgid "const char *" msgstr "const char *" @@ -126,9 +126,9 @@ msgstr "X" msgid ":c:member:`~PyTypeObject.tp_basicsize`" msgstr ":c:member:`~PyTypeObject.tp_basicsize`" -#: ../../c-api/typeobj.rst:46 ../../c-api/typeobj.rst:48 -#: ../../c-api/typeobj.rst:52 ../../c-api/typeobj.rst:99 -#: ../../c-api/typeobj.rst:120 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:46 +#: ../../c-api/typeobj.rst:48 ../../c-api/typeobj.rst:52 +#: ../../c-api/typeobj.rst:99 ../../c-api/typeobj.rst:120 #: ../../c-api/typeobj.rst:408 msgid ":c:type:`Py_ssize_t`" msgstr ":c:type:`Py_ssize_t`" @@ -402,7 +402,7 @@ msgstr ":c:type:`PyGetSetDef` []" msgid ":c:member:`~PyTypeObject.tp_base`" msgstr ":c:member:`~PyTypeObject.tp_base`" -#: ../../c-api/typeobj.rst:111 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:111 msgid ":c:type:`PyTypeObject` *" msgstr ":c:type:`PyTypeObject` *" @@ -414,10 +414,10 @@ msgstr "__base__" msgid ":c:member:`~PyTypeObject.tp_dict`" msgstr ":c:member:`~PyTypeObject.tp_dict`" -#: ../../c-api/typeobj.rst:113 ../../c-api/typeobj.rst:132 -#: ../../c-api/typeobj.rst:134 ../../c-api/typeobj.rst:136 -#: ../../c-api/typeobj.rst:138 ../../c-api/typeobj.rst:140 -#: ../../c-api/typeobj.rst:333 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:113 +#: ../../c-api/typeobj.rst:132 ../../c-api/typeobj.rst:134 +#: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:138 +#: ../../c-api/typeobj.rst:140 ../../c-api/typeobj.rst:333 #: ../../c-api/typeobj.rst:348 ../../c-api/typeobj.rst:360 #: ../../c-api/typeobj.rst:362 ../../c-api/typeobj.rst:373 #: ../../c-api/typeobj.rst:384 ../../c-api/typeobj.rst:396 @@ -893,8 +893,8 @@ msgstr "__int__" msgid ":c:member:`~PyNumberMethods.nb_reserved`" msgstr ":c:member:`~PyNumberMethods.nb_reserved`" -#: ../../c-api/typeobj.rst:271 ../../c-api/typeobj.rst:338 -#: ../../c-api/typeobj.rst:340 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:271 +#: ../../c-api/typeobj.rst:338 ../../c-api/typeobj.rst:340 #: ../../c-api/typeobj.rst:421 msgid "void *" msgstr "void *" @@ -1098,9 +1098,9 @@ msgstr "void" msgid ":c:type:`visitproc`" msgstr ":c:type:`visitproc`" -#: ../../c-api/typeobj.rst:342 ../../c-api/typeobj.rst:354 -#: ../../c-api/typeobj.rst:367 ../../c-api/typeobj.rst:378 -#: ../../c-api/typeobj.rst:390 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:342 +#: ../../c-api/typeobj.rst:354 ../../c-api/typeobj.rst:367 +#: ../../c-api/typeobj.rst:378 ../../c-api/typeobj.rst:390 #: ../../c-api/typeobj.rst:410 ../../c-api/typeobj.rst:421 #: ../../c-api/typeobj.rst:443 ../../c-api/typeobj.rst:448 #: ../../c-api/typeobj.rst:453 diff --git a/faq/design.po b/faq/design.po index e1f8b5ba5b..9261914de3 100644 --- a/faq/design.po +++ b/faq/design.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-27 00:09+0000\n" +"POT-Creation-Date: 2022-05-30 00:18+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -261,7 +261,7 @@ msgid "" "write() method." msgstr "" -#: ../../faq/design.rst:207 +#: ../../faq/design.rst:189 msgid "https://mail.python.org/pipermail/python-3000/2006-November/004643.html" msgstr "" "https://mail.python.org/pipermail/python-3000/2006-November/004643.html" diff --git a/howto/logging.po b/howto/logging.po index efa0cb84ef..d9e2d89000 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -134,7 +134,7 @@ msgid "" "described below (in increasing order of severity):" msgstr "" -#: ../../howto/logging.rst:69 ../../howto/logging.rst:854 +#: ../../howto/logging.rst:69 ../../howto/logging.rst:855 msgid "Level" msgstr "" @@ -142,7 +142,7 @@ msgstr "" msgid "When it's used" msgstr "" -#: ../../howto/logging.rst:71 ../../howto/logging.rst:864 +#: ../../howto/logging.rst:71 ../../howto/logging.rst:865 msgid "``DEBUG``" msgstr "``DEBUG``" @@ -151,7 +151,7 @@ msgid "" "Detailed information, typically of interest only when diagnosing problems." msgstr "" -#: ../../howto/logging.rst:74 ../../howto/logging.rst:862 +#: ../../howto/logging.rst:74 ../../howto/logging.rst:863 msgid "``INFO``" msgstr "``INFO``" @@ -159,7 +159,7 @@ msgstr "``INFO``" msgid "Confirmation that things are working as expected." msgstr "" -#: ../../howto/logging.rst:77 ../../howto/logging.rst:860 +#: ../../howto/logging.rst:77 ../../howto/logging.rst:861 msgid "``WARNING``" msgstr "``WARNING``" @@ -170,7 +170,7 @@ msgid "" "working as expected." msgstr "" -#: ../../howto/logging.rst:82 ../../howto/logging.rst:858 +#: ../../howto/logging.rst:82 ../../howto/logging.rst:859 msgid "``ERROR``" msgstr "``ERROR``" @@ -180,7 +180,7 @@ msgid "" "some function." msgstr "" -#: ../../howto/logging.rst:85 ../../howto/logging.rst:856 +#: ../../howto/logging.rst:85 ../../howto/logging.rst:857 msgid "``CRITICAL``" msgstr "``CRITICAL``" @@ -284,12 +284,13 @@ msgstr "" #: ../../howto/logging.rst:181 msgid "" "The call to :func:`basicConfig` should come *before* any calls to :func:" -"`debug`, :func:`info` etc. As it's intended as a one-off simple " -"configuration facility, only the first call will actually do anything: " -"subsequent calls are effectively no-ops." +"`debug`, :func:`info`, etc. Otherwise, those functions will call :func:" +"`basicConfig` for you with the default options. As it's intended as a one-" +"off simple configuration facility, only the first call will actually do " +"anything: subsequent calls are effectively no-ops." msgstr "" -#: ../../howto/logging.rst:186 +#: ../../howto/logging.rst:187 msgid "" "If you run the above script several times, the messages from successive runs " "are appended to the file *example.log*. If you want each run to start " @@ -297,27 +298,27 @@ msgid "" "*filemode* argument, by changing the call in the above example to::" msgstr "" -#: ../../howto/logging.rst:193 +#: ../../howto/logging.rst:194 msgid "" "The output will be the same as before, but the log file is no longer " "appended to, so the messages from earlier runs are lost." msgstr "" -#: ../../howto/logging.rst:198 +#: ../../howto/logging.rst:199 msgid "Logging from multiple modules" msgstr "" -#: ../../howto/logging.rst:200 +#: ../../howto/logging.rst:201 msgid "" "If your program consists of multiple modules, here's an example of how you " "could organize logging in it::" msgstr "" -#: ../../howto/logging.rst:224 +#: ../../howto/logging.rst:225 msgid "If you run *myapp.py*, you should see this in *myapp.log*:" msgstr "" -#: ../../howto/logging.rst:232 +#: ../../howto/logging.rst:233 msgid "" "which is hopefully what you were expecting to see. You can generalize this " "to multiple modules, using the pattern in *mylib.py*. Note that for this " @@ -328,21 +329,21 @@ msgid "" "advanced-tutorial`." msgstr "" -#: ../../howto/logging.rst:242 +#: ../../howto/logging.rst:243 msgid "Logging variable data" msgstr "" -#: ../../howto/logging.rst:244 +#: ../../howto/logging.rst:245 msgid "" "To log variable data, use a format string for the event description message " "and append the variable data as arguments. For example::" msgstr "" -#: ../../howto/logging.rst:250 +#: ../../howto/logging.rst:251 msgid "will display:" msgstr "" -#: ../../howto/logging.rst:256 +#: ../../howto/logging.rst:257 msgid "" "As you can see, merging of variable data into the event description message " "uses the old, %-style of string formatting. This is for backwards " @@ -352,21 +353,21 @@ msgid "" "tutorial: see :ref:`formatting-styles` for more information." msgstr "" -#: ../../howto/logging.rst:265 +#: ../../howto/logging.rst:266 msgid "Changing the format of displayed messages" msgstr "" -#: ../../howto/logging.rst:267 +#: ../../howto/logging.rst:268 msgid "" "To change the format which is used to display messages, you need to specify " "the format you want to use::" msgstr "" -#: ../../howto/logging.rst:276 +#: ../../howto/logging.rst:277 msgid "which would print:" msgstr "" -#: ../../howto/logging.rst:284 +#: ../../howto/logging.rst:285 msgid "" "Notice that the 'root' which appeared in earlier examples has disappeared. " "For a full set of things that can appear in format strings, you can refer to " @@ -376,42 +377,42 @@ msgid "" "This is described in the next section." msgstr "" -#: ../../howto/logging.rst:293 +#: ../../howto/logging.rst:294 msgid "Displaying the date/time in messages" msgstr "" -#: ../../howto/logging.rst:295 +#: ../../howto/logging.rst:296 msgid "" "To display the date and time of an event, you would place '%(asctime)s' in " "your format string::" msgstr "" -#: ../../howto/logging.rst:302 +#: ../../howto/logging.rst:303 msgid "which should print something like this:" msgstr "" -#: ../../howto/logging.rst:308 +#: ../../howto/logging.rst:309 msgid "" "The default format for date/time display (shown above) is like ISO8601 or :" "rfc:`3339`. If you need more control over the formatting of the date/time, " "provide a *datefmt* argument to ``basicConfig``, as in this example::" msgstr "" -#: ../../howto/logging.rst:316 +#: ../../howto/logging.rst:317 msgid "which would display something like this:" msgstr "" -#: ../../howto/logging.rst:322 +#: ../../howto/logging.rst:323 msgid "" "The format of the *datefmt* argument is the same as supported by :func:`time." "strftime`." msgstr "" -#: ../../howto/logging.rst:327 +#: ../../howto/logging.rst:328 msgid "Next Steps" msgstr "" -#: ../../howto/logging.rst:329 +#: ../../howto/logging.rst:330 msgid "" "That concludes the basic tutorial. It should be enough to get you up and " "running with logging. There's a lot more that the logging package offers, " @@ -420,7 +421,7 @@ msgid "" "of your favourite beverage and carry on." msgstr "" -#: ../../howto/logging.rst:335 +#: ../../howto/logging.rst:336 msgid "" "If your logging needs are simple, then use the above examples to incorporate " "logging into your own scripts, and if you run into problems or don't " @@ -429,50 +430,50 @@ msgid "" "python) and you should receive help before too long." msgstr "" -#: ../../howto/logging.rst:341 +#: ../../howto/logging.rst:342 msgid "" "Still here? You can carry on reading the next few sections, which provide a " "slightly more advanced/in-depth tutorial than the basic one above. After " "that, you can take a look at the :ref:`logging-cookbook`." msgstr "" -#: ../../howto/logging.rst:349 +#: ../../howto/logging.rst:350 msgid "Advanced Logging Tutorial" msgstr "" -#: ../../howto/logging.rst:351 +#: ../../howto/logging.rst:352 msgid "" "The logging library takes a modular approach and offers several categories " "of components: loggers, handlers, filters, and formatters." msgstr "" -#: ../../howto/logging.rst:354 +#: ../../howto/logging.rst:355 msgid "Loggers expose the interface that application code directly uses." msgstr "" -#: ../../howto/logging.rst:355 +#: ../../howto/logging.rst:356 msgid "" "Handlers send the log records (created by loggers) to the appropriate " "destination." msgstr "" -#: ../../howto/logging.rst:357 +#: ../../howto/logging.rst:358 msgid "" "Filters provide a finer grained facility for determining which log records " "to output." msgstr "" -#: ../../howto/logging.rst:359 +#: ../../howto/logging.rst:360 msgid "Formatters specify the layout of log records in the final output." msgstr "" -#: ../../howto/logging.rst:361 +#: ../../howto/logging.rst:362 msgid "" "Log event information is passed between loggers, handlers, filters and " "formatters in a :class:`LogRecord` instance." msgstr "" -#: ../../howto/logging.rst:364 +#: ../../howto/logging.rst:365 msgid "" "Logging is performed by calling methods on instances of the :class:`Logger` " "class (hereafter called :dfn:`loggers`). Each instance has a name, and they " @@ -483,19 +484,19 @@ msgid "" "originates." msgstr "" -#: ../../howto/logging.rst:371 +#: ../../howto/logging.rst:372 msgid "" "A good convention to use when naming loggers is to use a module-level " "logger, in each module which uses logging, named as follows::" msgstr "" -#: ../../howto/logging.rst:376 +#: ../../howto/logging.rst:377 msgid "" "This means that logger names track the package/module hierarchy, and it's " "intuitively obvious where events are logged just from the logger name." msgstr "" -#: ../../howto/logging.rst:379 +#: ../../howto/logging.rst:380 msgid "" "The root of the hierarchy of loggers is called the root logger. That's the " "logger used by the functions :func:`debug`, :func:`info`, :func:`warning`, :" @@ -504,7 +505,7 @@ msgid "" "root logger's name is printed as 'root' in the logged output." msgstr "" -#: ../../howto/logging.rst:385 +#: ../../howto/logging.rst:386 msgid "" "It is, of course, possible to log messages to different destinations. " "Support is included in the package for writing log messages to files, HTTP " @@ -515,7 +516,7 @@ msgid "" "built-in handler classes." msgstr "" -#: ../../howto/logging.rst:392 +#: ../../howto/logging.rst:393 msgid "" "By default, no destination is set for any logging messages. You can specify " "a destination (such as console or file) by using :func:`basicConfig` as in " @@ -527,32 +528,32 @@ msgid "" "message output." msgstr "" -#: ../../howto/logging.rst:400 +#: ../../howto/logging.rst:401 msgid "The default format set by :func:`basicConfig` for messages is:" msgstr "" -#: ../../howto/logging.rst:406 +#: ../../howto/logging.rst:407 msgid "" "You can change this by passing a format string to :func:`basicConfig` with " "the *format* keyword argument. For all options regarding how a format string " "is constructed, see :ref:`formatter-objects`." msgstr "" -#: ../../howto/logging.rst:411 +#: ../../howto/logging.rst:412 msgid "Logging Flow" msgstr "" -#: ../../howto/logging.rst:413 +#: ../../howto/logging.rst:414 msgid "" "The flow of log event information in loggers and handlers is illustrated in " "the following diagram." msgstr "" -#: ../../howto/logging.rst:419 +#: ../../howto/logging.rst:420 msgid "Loggers" msgstr "" -#: ../../howto/logging.rst:421 +#: ../../howto/logging.rst:422 msgid "" ":class:`Logger` objects have a threefold job. First, they expose several " "methods to application code so that applications can log messages at " @@ -562,17 +563,17 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:427 +#: ../../howto/logging.rst:428 msgid "" "The most widely used methods on logger objects fall into two categories: " "configuration and message sending." msgstr "" -#: ../../howto/logging.rst:430 +#: ../../howto/logging.rst:431 msgid "These are the most common configuration methods:" msgstr "" -#: ../../howto/logging.rst:432 +#: ../../howto/logging.rst:433 msgid "" ":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " "will handle, where debug is the lowest built-in severity level and critical " @@ -581,32 +582,32 @@ msgid "" "messages and will ignore DEBUG messages." msgstr "" -#: ../../howto/logging.rst:438 +#: ../../howto/logging.rst:439 msgid "" ":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " "handler objects from the logger object. Handlers are covered in more detail " "in :ref:`handler-basic`." msgstr "" -#: ../../howto/logging.rst:442 +#: ../../howto/logging.rst:443 msgid "" ":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " "filter objects from the logger object. Filters are covered in more detail " "in :ref:`filter`." msgstr "" -#: ../../howto/logging.rst:446 +#: ../../howto/logging.rst:447 msgid "" "You don't need to always call these methods on every logger you create. See " "the last two paragraphs in this section." msgstr "" -#: ../../howto/logging.rst:449 +#: ../../howto/logging.rst:450 msgid "" "With the logger object configured, the following methods create log messages:" msgstr "" -#: ../../howto/logging.rst:451 +#: ../../howto/logging.rst:452 msgid "" ":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" "`Logger.error`, and :meth:`Logger.critical` all create log records with a " @@ -619,14 +620,14 @@ msgid "" "exception information." msgstr "" -#: ../../howto/logging.rst:461 +#: ../../howto/logging.rst:462 msgid "" ":meth:`Logger.exception` creates a log message similar to :meth:`Logger." "error`. The difference is that :meth:`Logger.exception` dumps a stack trace " "along with it. Call this method only from an exception handler." msgstr "" -#: ../../howto/logging.rst:465 +#: ../../howto/logging.rst:466 msgid "" ":meth:`Logger.log` takes a log level as an explicit argument. This is a " "little more verbose for logging messages than using the log level " @@ -634,7 +635,7 @@ msgid "" "levels." msgstr "" -#: ../../howto/logging.rst:469 +#: ../../howto/logging.rst:470 msgid "" ":func:`getLogger` returns a reference to a logger instance with the " "specified name if it is provided, or ``root`` if not. The names are period-" @@ -646,7 +647,7 @@ msgid "" "descendants of ``foo``." msgstr "" -#: ../../howto/logging.rst:477 +#: ../../howto/logging.rst:478 msgid "" "Loggers have a concept of *effective level*. If a level is not explicitly " "set on a logger, the level of its parent is used instead as its effective " @@ -658,7 +659,7 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:485 +#: ../../howto/logging.rst:486 msgid "" "Child loggers propagate messages up to the handlers associated with their " "ancestor loggers. Because of this, it is unnecessary to define and configure " @@ -668,11 +669,11 @@ msgid "" "attribute of a logger to ``False``.)" msgstr "" -#: ../../howto/logging.rst:496 +#: ../../howto/logging.rst:497 msgid "Handlers" msgstr "" -#: ../../howto/logging.rst:498 +#: ../../howto/logging.rst:499 msgid "" ":class:`~logging.Handler` objects are responsible for dispatching the " "appropriate log messages (based on the log messages' severity) to the " @@ -685,14 +686,14 @@ msgid "" "of a specific severity to a specific location." msgstr "" -#: ../../howto/logging.rst:508 +#: ../../howto/logging.rst:509 msgid "" "The standard library includes quite a few handler types (see :ref:`useful-" "handlers`); the tutorials use mainly :class:`StreamHandler` and :class:" "`FileHandler` in its examples." msgstr "" -#: ../../howto/logging.rst:512 +#: ../../howto/logging.rst:513 msgid "" "There are very few methods in a handler for application developers to " "concern themselves with. The only handler methods that seem relevant for " @@ -700,7 +701,7 @@ msgid "" "not creating custom handlers) are the following configuration methods:" msgstr "" -#: ../../howto/logging.rst:517 +#: ../../howto/logging.rst:518 msgid "" "The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " "the lowest severity that will be dispatched to the appropriate destination. " @@ -710,19 +711,19 @@ msgid "" "on." msgstr "" -#: ../../howto/logging.rst:523 +#: ../../howto/logging.rst:524 msgid "" ":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " "use." msgstr "" -#: ../../howto/logging.rst:526 +#: ../../howto/logging.rst:527 msgid "" ":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " "configure and deconfigure filter objects on handlers." msgstr "" -#: ../../howto/logging.rst:529 +#: ../../howto/logging.rst:530 msgid "" "Application code should not directly instantiate and use instances of :class:" "`Handler`. Instead, the :class:`Handler` class is a base class that defines " @@ -730,11 +731,11 @@ msgid "" "behavior that child classes can use (or override)." msgstr "" -#: ../../howto/logging.rst:536 +#: ../../howto/logging.rst:537 msgid "Formatters" msgstr "" -#: ../../howto/logging.rst:538 +#: ../../howto/logging.rst:539 msgid "" "Formatter objects configure the final order, structure, and contents of the " "log message. Unlike the base :class:`logging.Handler` class, application " @@ -744,19 +745,19 @@ msgid "" "string and a style indicator." msgstr "" -#: ../../howto/logging.rst:547 +#: ../../howto/logging.rst:548 msgid "" "If there is no message format string, the default is to use the raw " "message. If there is no date format string, the default date format is:" msgstr "" -#: ../../howto/logging.rst:554 +#: ../../howto/logging.rst:555 msgid "" "with the milliseconds tacked on at the end. The ``style`` is one of `%`, '{' " "or '$'. If one of these is not specified, then '%' will be used." msgstr "" -#: ../../howto/logging.rst:557 +#: ../../howto/logging.rst:558 msgid "" "If the ``style`` is '%', the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :" @@ -766,18 +767,18 @@ msgid "" "conform to what is expected by :meth:`string.Template.substitute`." msgstr "" -#: ../../howto/logging.rst:564 +#: ../../howto/logging.rst:565 msgid "Added the ``style`` parameter." msgstr "新增 ``style`` 參數。" -#: ../../howto/logging.rst:567 +#: ../../howto/logging.rst:568 msgid "" "The following message format string will log the time in a human-readable " "format, the severity of the message, and the contents of the message, in " "that order::" msgstr "" -#: ../../howto/logging.rst:573 +#: ../../howto/logging.rst:574 msgid "" "Formatters use a user-configurable function to convert the creation time of " "a record to a tuple. By default, :func:`time.localtime` is used; to change " @@ -788,68 +789,68 @@ msgid "" "in the Formatter class (to ``time.gmtime`` for GMT display)." msgstr "" -#: ../../howto/logging.rst:583 +#: ../../howto/logging.rst:584 msgid "Configuring Logging" msgstr "" -#: ../../howto/logging.rst:587 +#: ../../howto/logging.rst:588 msgid "Programmers can configure logging in three ways:" msgstr "" -#: ../../howto/logging.rst:589 +#: ../../howto/logging.rst:590 msgid "" "Creating loggers, handlers, and formatters explicitly using Python code that " "calls the configuration methods listed above." msgstr "" -#: ../../howto/logging.rst:591 +#: ../../howto/logging.rst:592 msgid "" "Creating a logging config file and reading it using the :func:`fileConfig` " "function." msgstr "" -#: ../../howto/logging.rst:593 +#: ../../howto/logging.rst:594 msgid "" "Creating a dictionary of configuration information and passing it to the :" "func:`dictConfig` function." msgstr "" -#: ../../howto/logging.rst:596 +#: ../../howto/logging.rst:597 msgid "" "For the reference documentation on the last two options, see :ref:`logging-" "config-api`. The following example configures a very simple logger, a " "console handler, and a simple formatter using Python code::" msgstr "" -#: ../../howto/logging.rst:626 +#: ../../howto/logging.rst:627 msgid "" "Running this module from the command line produces the following output:" msgstr "" -#: ../../howto/logging.rst:637 +#: ../../howto/logging.rst:638 msgid "" "The following Python module creates a logger, handler, and formatter nearly " "identical to those in the example listed above, with the only difference " "being the names of the objects::" msgstr "" -#: ../../howto/logging.rst:656 +#: ../../howto/logging.rst:657 msgid "Here is the logging.conf file:" msgstr "" -#: ../../howto/logging.rst:688 +#: ../../howto/logging.rst:689 msgid "" "The output is nearly identical to that of the non-config-file-based example:" msgstr "" -#: ../../howto/logging.rst:699 +#: ../../howto/logging.rst:700 msgid "" "You can see that the config file approach has a few advantages over the " "Python code approach, mainly separation of configuration and code and the " "ability of noncoders to easily modify the logging properties." msgstr "" -#: ../../howto/logging.rst:703 +#: ../../howto/logging.rst:704 msgid "" "The :func:`fileConfig` function takes a default parameter, " "``disable_existing_loggers``, which defaults to ``True`` for reasons of " @@ -860,7 +861,7 @@ msgid "" "information, and specify ``False`` for this parameter if you wish." msgstr "" -#: ../../howto/logging.rst:711 +#: ../../howto/logging.rst:712 msgid "" "The dictionary passed to :func:`dictConfig` can also specify a Boolean value " "with key ``disable_existing_loggers``, which if not specified explicitly in " @@ -869,7 +870,7 @@ msgid "" "want - in which case, provide the key explicitly with a value of ``False``." msgstr "" -#: ../../howto/logging.rst:721 +#: ../../howto/logging.rst:722 msgid "" "Note that the class names referenced in config files need to be either " "relative to the logging module, or absolute values which can be resolved " @@ -880,7 +881,7 @@ msgid "" "path)." msgstr "" -#: ../../howto/logging.rst:729 +#: ../../howto/logging.rst:730 msgid "" "In Python 3.2, a new means of configuring logging has been introduced, using " "dictionaries to hold configuration information. This provides a superset of " @@ -895,23 +896,23 @@ msgid "" "a socket, or use whatever approach makes sense for your application." msgstr "" -#: ../../howto/logging.rst:741 +#: ../../howto/logging.rst:742 msgid "" "Here's an example of the same configuration as above, in YAML format for the " "new dictionary-based approach:" msgstr "" -#: ../../howto/logging.rst:765 +#: ../../howto/logging.rst:766 msgid "" "For more information about logging using a dictionary, see :ref:`logging-" "config-api`." msgstr "" -#: ../../howto/logging.rst:769 +#: ../../howto/logging.rst:770 msgid "What happens if no configuration is provided" msgstr "" -#: ../../howto/logging.rst:771 +#: ../../howto/logging.rst:772 msgid "" "If no logging configuration is provided, it is possible to have a situation " "where a logging event needs to be output, but no handlers can be found to " @@ -919,27 +920,27 @@ msgid "" "circumstances is dependent on the Python version." msgstr "" -#: ../../howto/logging.rst:776 +#: ../../howto/logging.rst:777 msgid "For versions of Python prior to 3.2, the behaviour is as follows:" msgstr "" -#: ../../howto/logging.rst:778 +#: ../../howto/logging.rst:779 msgid "" "If *logging.raiseExceptions* is ``False`` (production mode), the event is " "silently dropped." msgstr "" -#: ../../howto/logging.rst:781 +#: ../../howto/logging.rst:782 msgid "" "If *logging.raiseExceptions* is ``True`` (development mode), a message 'No " "handlers could be found for logger X.Y.Z' is printed once." msgstr "" -#: ../../howto/logging.rst:784 +#: ../../howto/logging.rst:785 msgid "In Python 3.2 and later, the behaviour is as follows:" msgstr "" -#: ../../howto/logging.rst:786 +#: ../../howto/logging.rst:787 msgid "" "The event is output using a 'handler of last resort', stored in ``logging." "lastResort``. This internal handler is not associated with any logger, and " @@ -951,17 +952,17 @@ msgid "" "severities will be output." msgstr "" -#: ../../howto/logging.rst:795 +#: ../../howto/logging.rst:796 msgid "" "To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to " "``None``." msgstr "" -#: ../../howto/logging.rst:800 +#: ../../howto/logging.rst:801 msgid "Configuring Logging for a Library" msgstr "" -#: ../../howto/logging.rst:802 +#: ../../howto/logging.rst:803 msgid "" "When developing a library which uses logging, you should take care to " "document how the library uses logging - for example, the names of loggers " @@ -972,7 +973,7 @@ msgid "" "is regarded as the best default behaviour." msgstr "" -#: ../../howto/logging.rst:810 +#: ../../howto/logging.rst:811 msgid "" "If for some reason you *don't* want these messages printed in the absence of " "any logging configuration, you can attach a do-nothing handler to the top-" @@ -984,7 +985,7 @@ msgid "" "to those handlers, as normal." msgstr "" -#: ../../howto/logging.rst:819 +#: ../../howto/logging.rst:820 msgid "" "A do-nothing handler is included in the logging package: :class:`~logging." "NullHandler` (since Python 3.1). An instance of this handler could be added " @@ -995,14 +996,14 @@ msgid "" "etc. then the code::" msgstr "" -#: ../../howto/logging.rst:830 +#: ../../howto/logging.rst:831 msgid "" "should have the desired effect. If an organisation produces a number of " "libraries, then the logger name specified can be 'orgname.foo' rather than " "just 'foo'." msgstr "" -#: ../../howto/logging.rst:834 +#: ../../howto/logging.rst:835 msgid "" "It is strongly advised that you *do not add any handlers other than* :class:" "`~logging.NullHandler` *to your library's loggers*. This is because the " @@ -1013,11 +1014,11 @@ msgid "" "carry out unit tests and deliver logs which suit their requirements." msgstr "" -#: ../../howto/logging.rst:845 +#: ../../howto/logging.rst:846 msgid "Logging Levels" msgstr "" -#: ../../howto/logging.rst:847 +#: ../../howto/logging.rst:848 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -1026,39 +1027,39 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../howto/logging.rst:854 +#: ../../howto/logging.rst:855 msgid "Numeric value" msgstr "" -#: ../../howto/logging.rst:856 +#: ../../howto/logging.rst:857 msgid "50" msgstr "50" -#: ../../howto/logging.rst:858 +#: ../../howto/logging.rst:859 msgid "40" msgstr "40" -#: ../../howto/logging.rst:860 +#: ../../howto/logging.rst:861 msgid "30" msgstr "30" -#: ../../howto/logging.rst:862 +#: ../../howto/logging.rst:863 msgid "20" msgstr "20" -#: ../../howto/logging.rst:864 +#: ../../howto/logging.rst:865 msgid "10" msgstr "10" -#: ../../howto/logging.rst:866 +#: ../../howto/logging.rst:867 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../howto/logging.rst:866 +#: ../../howto/logging.rst:867 msgid "0" msgstr "0" -#: ../../howto/logging.rst:869 +#: ../../howto/logging.rst:870 msgid "" "Levels can also be associated with loggers, being set either by the " "developer or through loading a saved logging configuration. When a logging " @@ -1068,14 +1069,14 @@ msgid "" "basic mechanism controlling the verbosity of logging output." msgstr "" -#: ../../howto/logging.rst:876 +#: ../../howto/logging.rst:877 msgid "" "Logging messages are encoded as instances of the :class:`~logging.LogRecord` " "class. When a logger decides to actually log an event, a :class:`~logging." "LogRecord` instance is created from the logging message." msgstr "" -#: ../../howto/logging.rst:880 +#: ../../howto/logging.rst:881 msgid "" "Logging messages are subjected to a dispatch mechanism through the use of :" "dfn:`handlers`, which are instances of subclasses of the :class:`Handler` " @@ -1092,7 +1093,7 @@ msgid "" "at which point the passing to ancestor handlers stops)." msgstr "" -#: ../../howto/logging.rst:894 +#: ../../howto/logging.rst:895 msgid "" "Just as for loggers, handlers can have levels associated with them. A " "handler's level acts as a filter in the same way as a logger's level does. " @@ -1102,11 +1103,11 @@ msgid "" "`~Handler.emit`." msgstr "" -#: ../../howto/logging.rst:903 +#: ../../howto/logging.rst:904 msgid "Custom Levels" msgstr "" -#: ../../howto/logging.rst:905 +#: ../../howto/logging.rst:906 msgid "" "Defining your own levels is possible, but should not be necessary, as the " "existing levels have been chosen on the basis of practical experience. " @@ -1119,27 +1120,27 @@ msgid "" "given numeric value might mean different things for different libraries." msgstr "" -#: ../../howto/logging.rst:918 +#: ../../howto/logging.rst:919 msgid "Useful Handlers" msgstr "" -#: ../../howto/logging.rst:920 +#: ../../howto/logging.rst:921 msgid "" "In addition to the base :class:`Handler` class, many useful subclasses are " "provided:" msgstr "" -#: ../../howto/logging.rst:923 +#: ../../howto/logging.rst:924 msgid "" ":class:`StreamHandler` instances send messages to streams (file-like " "objects)." msgstr "" -#: ../../howto/logging.rst:926 +#: ../../howto/logging.rst:927 msgid ":class:`FileHandler` instances send messages to disk files." msgstr "" -#: ../../howto/logging.rst:928 +#: ../../howto/logging.rst:929 msgid "" ":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " "rotate log files at a certain point. It is not meant to be instantiated " @@ -1147,61 +1148,61 @@ msgid "" "`~handlers.TimedRotatingFileHandler`." msgstr "" -#: ../../howto/logging.rst:933 +#: ../../howto/logging.rst:934 msgid "" ":class:`~handlers.RotatingFileHandler` instances send messages to disk " "files, with support for maximum log file sizes and log file rotation." msgstr "" -#: ../../howto/logging.rst:936 +#: ../../howto/logging.rst:937 msgid "" ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " "files, rotating the log file at certain timed intervals." msgstr "" -#: ../../howto/logging.rst:939 +#: ../../howto/logging.rst:940 msgid "" ":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:942 +#: ../../howto/logging.rst:943 msgid "" ":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:945 +#: ../../howto/logging.rst:946 msgid "" ":class:`~handlers.SMTPHandler` instances send messages to a designated email " "address." msgstr "" -#: ../../howto/logging.rst:948 +#: ../../howto/logging.rst:949 msgid "" ":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " "daemon, possibly on a remote machine." msgstr "" -#: ../../howto/logging.rst:951 +#: ../../howto/logging.rst:952 msgid "" ":class:`~handlers.NTEventLogHandler` instances send messages to a Windows " "NT/2000/XP event log." msgstr "" -#: ../../howto/logging.rst:954 +#: ../../howto/logging.rst:955 msgid "" ":class:`~handlers.MemoryHandler` instances send messages to a buffer in " "memory, which is flushed whenever specific criteria are met." msgstr "" -#: ../../howto/logging.rst:957 +#: ../../howto/logging.rst:958 msgid "" ":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " "using either ``GET`` or ``POST`` semantics." msgstr "" -#: ../../howto/logging.rst:960 +#: ../../howto/logging.rst:961 msgid "" ":class:`~handlers.WatchedFileHandler` instances watch the file they are " "logging to. If the file changes, it is closed and reopened using the file " @@ -1209,13 +1210,13 @@ msgid "" "support the underlying mechanism used." msgstr "" -#: ../../howto/logging.rst:965 +#: ../../howto/logging.rst:966 msgid "" ":class:`~handlers.QueueHandler` instances send messages to a queue, such as " "those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../howto/logging.rst:968 +#: ../../howto/logging.rst:969 msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " @@ -1224,15 +1225,15 @@ msgid "" "more information." msgstr "" -#: ../../howto/logging.rst:974 +#: ../../howto/logging.rst:975 msgid "The :class:`NullHandler` class." msgstr "" -#: ../../howto/logging.rst:977 +#: ../../howto/logging.rst:978 msgid "The :class:`~handlers.QueueHandler` class." msgstr "" -#: ../../howto/logging.rst:980 +#: ../../howto/logging.rst:981 msgid "" "The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " "classes are defined in the core logging package. The other handlers are " @@ -1240,14 +1241,14 @@ msgid "" "module, :mod:`logging.config`, for configuration functionality.)" msgstr "" -#: ../../howto/logging.rst:985 +#: ../../howto/logging.rst:986 msgid "" "Logged messages are formatted for presentation through instances of the :" "class:`Formatter` class. They are initialized with a format string suitable " "for use with the % operator and a dictionary." msgstr "" -#: ../../howto/logging.rst:989 +#: ../../howto/logging.rst:990 msgid "" "For formatting multiple messages in a batch, instances of :class:`~handlers." "BufferingFormatter` can be used. In addition to the format string (which is " @@ -1255,7 +1256,7 @@ msgid "" "trailer format strings." msgstr "" -#: ../../howto/logging.rst:994 +#: ../../howto/logging.rst:995 msgid "" "When filtering based on logger level and/or handler level is not enough, " "instances of :class:`Filter` can be added to both :class:`Logger` and :class:" @@ -1265,18 +1266,18 @@ msgid "" "value, the message is not processed further." msgstr "" -#: ../../howto/logging.rst:1001 +#: ../../howto/logging.rst:1002 msgid "" "The basic :class:`Filter` functionality allows filtering by specific logger " "name. If this feature is used, messages sent to the named logger and its " "children are allowed through the filter, and all others dropped." msgstr "" -#: ../../howto/logging.rst:1009 +#: ../../howto/logging.rst:1010 msgid "Exceptions raised during logging" msgstr "" -#: ../../howto/logging.rst:1011 +#: ../../howto/logging.rst:1012 msgid "" "The logging package is designed to swallow exceptions which occur while " "logging in production. This is so that errors which occur while handling " @@ -1284,7 +1285,7 @@ msgid "" "errors - do not cause the application using logging to terminate prematurely." msgstr "" -#: ../../howto/logging.rst:1016 +#: ../../howto/logging.rst:1017 msgid "" ":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " "swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " @@ -1292,7 +1293,7 @@ msgid "" "handleError` method." msgstr "" -#: ../../howto/logging.rst:1021 +#: ../../howto/logging.rst:1022 msgid "" "The default implementation of :meth:`~Handler.handleError` in :class:" "`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " @@ -1300,7 +1301,7 @@ msgid "" "the exception is swallowed." msgstr "" -#: ../../howto/logging.rst:1026 +#: ../../howto/logging.rst:1027 msgid "" "The default value of :data:`raiseExceptions` is ``True``. This is because " "during development, you typically want to be notified of any exceptions that " @@ -1308,11 +1309,11 @@ msgid "" "production usage." msgstr "" -#: ../../howto/logging.rst:1036 +#: ../../howto/logging.rst:1037 msgid "Using arbitrary objects as messages" msgstr "" -#: ../../howto/logging.rst:1038 +#: ../../howto/logging.rst:1039 msgid "" "In the preceding sections and examples, it has been assumed that the message " "passed when logging the event is a string. However, this is not the only " @@ -1324,11 +1325,11 @@ msgid "" "the wire." msgstr "" -#: ../../howto/logging.rst:1049 +#: ../../howto/logging.rst:1050 msgid "Optimization" msgstr "" -#: ../../howto/logging.rst:1051 +#: ../../howto/logging.rst:1052 msgid "" "Formatting of message arguments is deferred until it cannot be avoided. " "However, computing the arguments passed to the logging method can also be " @@ -1339,13 +1340,13 @@ msgid "" "code like this::" msgstr "" -#: ../../howto/logging.rst:1063 +#: ../../howto/logging.rst:1064 msgid "" "so that if the logger's threshold is set above ``DEBUG``, the calls to :func:" "`expensive_func1` and :func:`expensive_func2` are never made." msgstr "" -#: ../../howto/logging.rst:1066 +#: ../../howto/logging.rst:1067 msgid "" "In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " "than you'd like (e.g. for deeply nested loggers where an explicit level is " @@ -1357,7 +1358,7 @@ msgid "" "while the application is running (which is not all that common)." msgstr "" -#: ../../howto/logging.rst:1075 +#: ../../howto/logging.rst:1076 msgid "" "There are other optimizations which can be made for specific applications " "which need more precise control over what logging information is collected. " @@ -1365,82 +1366,82 @@ msgid "" "you don't need:" msgstr "" -#: ../../howto/logging.rst:1081 +#: ../../howto/logging.rst:1082 msgid "What you don't want to collect" msgstr "" -#: ../../howto/logging.rst:1081 +#: ../../howto/logging.rst:1082 msgid "How to avoid collecting it" msgstr "" -#: ../../howto/logging.rst:1083 +#: ../../howto/logging.rst:1084 msgid "Information about where calls were made from." msgstr "" -#: ../../howto/logging.rst:1083 +#: ../../howto/logging.rst:1084 msgid "" "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." "_getframe`, which may help to speed up your code in environments like PyPy " "(which can't speed up code that uses :func:`sys._getframe`)." msgstr "" -#: ../../howto/logging.rst:1089 +#: ../../howto/logging.rst:1090 msgid "Threading information." msgstr "" -#: ../../howto/logging.rst:1089 +#: ../../howto/logging.rst:1090 msgid "Set ``logging.logThreads`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1091 +#: ../../howto/logging.rst:1092 msgid "Current process ID (:func:`os.getpid`)" msgstr "" -#: ../../howto/logging.rst:1091 +#: ../../howto/logging.rst:1092 msgid "Set ``logging.logProcesses`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1093 +#: ../../howto/logging.rst:1094 msgid "" "Current process name when using ``multiprocessing`` to manage multiple " "processes." msgstr "" -#: ../../howto/logging.rst:1093 +#: ../../howto/logging.rst:1094 msgid "Set ``logging.logMultiprocessing`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1097 +#: ../../howto/logging.rst:1098 msgid "" "Also note that the core logging module only includes the basic handlers. If " "you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " "won't take up any memory." msgstr "" -#: ../../howto/logging.rst:1104 +#: ../../howto/logging.rst:1105 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging.rst:1104 +#: ../../howto/logging.rst:1105 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging.rst:1107 +#: ../../howto/logging.rst:1108 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging.rst:1107 +#: ../../howto/logging.rst:1108 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging.rst:1110 +#: ../../howto/logging.rst:1111 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging.rst:1110 +#: ../../howto/logging.rst:1111 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging.rst:1112 +#: ../../howto/logging.rst:1113 msgid ":ref:`A logging cookbook `" msgstr "" diff --git a/library/importlib.po b/library/importlib.po index 1620412373..94ad73a135 100644 --- a/library/importlib.po +++ b/library/importlib.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-05-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2010,32 +2010,38 @@ msgstr "" #: ../../library/importlib.rst:1750 msgid "" "If you need to find out if a module can be imported without actually doing " -"the import, then you should use :func:`importlib.util.find_spec`. ::" +"the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1773 +#: ../../library/importlib.rst:1753 +msgid "" +"Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." +"find_spec` will import the parent module. ::" +msgstr "" + +#: ../../library/importlib.rst:1776 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1775 +#: ../../library/importlib.rst:1778 msgid "" "To import a Python source file directly, use the following recipe (Python " "3.5 and newer only)::" msgstr "" -#: ../../library/importlib.rst:1793 +#: ../../library/importlib.rst:1796 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1795 +#: ../../library/importlib.rst:1798 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1817 +#: ../../library/importlib.rst:1820 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1819 +#: ../../library/importlib.rst:1822 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -2049,11 +2055,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1851 +#: ../../library/importlib.rst:1854 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1853 +#: ../../library/importlib.rst:1856 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " diff --git a/library/logging.po b/library/logging.po index 02dbbf0b68..703f97db54 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-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-05-30 00:18+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-" @@ -200,7 +200,7 @@ msgid "" "level." msgstr "" -#: ../../library/logging.rst:126 ../../library/logging.rst:435 +#: ../../library/logging.rst:126 ../../library/logging.rst:439 msgid "See :ref:`levels` for a list of levels." msgstr "層級清單請見 :ref:`levels`\\ 。" @@ -264,7 +264,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:181 ../../library/logging.rst:986 +#: ../../library/logging.rst:181 ../../library/logging.rst:990 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -276,14 +276,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:190 ../../library/logging.rst:995 +#: ../../library/logging.rst:190 ../../library/logging.rst:999 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:198 ../../library/logging.rst:1003 +#: ../../library/logging.rst:198 ../../library/logging.rst:1007 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -314,7 +314,7 @@ msgstr "" msgid "would print something like" msgstr "" -#: ../../library/logging.rst:227 ../../library/logging.rst:1023 +#: ../../library/logging.rst:227 ../../library/logging.rst:1027 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 " @@ -332,7 +332,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:238 ../../library/logging.rst:1034 +#: ../../library/logging.rst:238 ../../library/logging.rst:1038 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -343,71 +343,78 @@ msgid "" "particular :class:`Handler`\\ s." msgstr "" -#: ../../library/logging.rst:245 ../../library/logging.rst:1041 +#: ../../library/logging.rst:245 +msgid "" +"If no handler is attached to this logger (or any of its ancestors, taking " +"into account the relevant :attr:`Logger.propagate` attributes), the message " +"will be sent to the handler set on :attr:`lastResort`." +msgstr "" + +#: ../../library/logging.rst:249 ../../library/logging.rst:1049 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" -#: ../../library/logging.rst:248 +#: ../../library/logging.rst:252 msgid "The *exc_info* parameter can now accept exception instances." msgstr "" -#: ../../library/logging.rst:251 +#: ../../library/logging.rst:255 msgid "The *stacklevel* parameter was added." msgstr "新增 *stacklevel* 參數。" -#: ../../library/logging.rst:257 +#: ../../library/logging.rst:261 msgid "" "Logs a message with level :const:`INFO` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:263 +#: ../../library/logging.rst:267 msgid "" "Logs a message with level :const:`WARNING` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:266 +#: ../../library/logging.rst:270 msgid "" "There is an obsolete method ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:272 +#: ../../library/logging.rst:276 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:278 +#: ../../library/logging.rst:282 msgid "" "Logs a message with level :const:`CRITICAL` on this logger. The arguments " "are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:284 +#: ../../library/logging.rst:288 msgid "" "Logs a message with integer level *level* on this logger. The other " "arguments are interpreted as for :meth:`debug`." msgstr "" -#: ../../library/logging.rst:290 +#: ../../library/logging.rst:294 msgid "" "Logs a message with level :const:`ERROR` on this logger. The arguments are " "interpreted as for :meth:`debug`. Exception info is added to the logging " "message. This method should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:297 +#: ../../library/logging.rst:301 msgid "Adds the specified filter *filter* to this logger." msgstr "" -#: ../../library/logging.rst:302 +#: ../../library/logging.rst:306 msgid "Removes the specified filter *filter* from this logger." msgstr "" -#: ../../library/logging.rst:307 +#: ../../library/logging.rst:311 msgid "" "Apply this logger's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -416,22 +423,22 @@ msgid "" "processing of the record occurs." msgstr "" -#: ../../library/logging.rst:316 +#: ../../library/logging.rst:320 msgid "Adds the specified handler *hdlr* to this logger." msgstr "" -#: ../../library/logging.rst:321 +#: ../../library/logging.rst:325 msgid "Removes the specified handler *hdlr* from this logger." msgstr "" -#: ../../library/logging.rst:326 +#: ../../library/logging.rst:330 msgid "" "Finds the caller's source filename and line number. Returns the filename, " "line number, function name and stack information as a 4-element tuple. The " "stack information is returned as ``None`` unless *stack_info* is ``True``." msgstr "" -#: ../../library/logging.rst:330 +#: ../../library/logging.rst:334 msgid "" "The *stacklevel* parameter is passed from code calling the :meth:`debug` and " "other APIs. If greater than 1, the excess is used to skip stack frames " @@ -441,7 +448,7 @@ msgid "" "calls it." msgstr "" -#: ../../library/logging.rst:340 +#: ../../library/logging.rst:344 msgid "" "Handles a record by passing it to all handlers associated with this logger " "and its ancestors (until a false value of *propagate* is found). This method " @@ -450,13 +457,13 @@ msgid "" "filter`." msgstr "" -#: ../../library/logging.rst:348 +#: ../../library/logging.rst:352 msgid "" "This is a factory method which can be overridden in subclasses to create " "specialized :class:`LogRecord` instances." msgstr "" -#: ../../library/logging.rst:353 +#: ../../library/logging.rst:357 msgid "" "Checks to see if this logger has any handlers configured. This is done by " "looking for handlers in this logger and its parents in the logger hierarchy. " @@ -466,15 +473,15 @@ msgid "" "the existence of handlers." msgstr "" -#: ../../library/logging.rst:362 +#: ../../library/logging.rst:366 msgid "Loggers can now be pickled and unpickled." msgstr "" -#: ../../library/logging.rst:368 +#: ../../library/logging.rst:372 msgid "Logging Levels" msgstr "" -#: ../../library/logging.rst:370 +#: ../../library/logging.rst:374 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -483,67 +490,67 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../library/logging.rst:377 +#: ../../library/logging.rst:381 msgid "Level" msgstr "" -#: ../../library/logging.rst:377 +#: ../../library/logging.rst:381 msgid "Numeric value" msgstr "" -#: ../../library/logging.rst:379 +#: ../../library/logging.rst:383 msgid "``CRITICAL``" msgstr "``CRITICAL``" -#: ../../library/logging.rst:379 +#: ../../library/logging.rst:383 msgid "50" msgstr "50" -#: ../../library/logging.rst:381 +#: ../../library/logging.rst:385 msgid "``ERROR``" msgstr "``ERROR``" -#: ../../library/logging.rst:381 +#: ../../library/logging.rst:385 msgid "40" msgstr "40" -#: ../../library/logging.rst:383 +#: ../../library/logging.rst:387 msgid "``WARNING``" msgstr "``WARNING``" -#: ../../library/logging.rst:383 +#: ../../library/logging.rst:387 msgid "30" msgstr "30" -#: ../../library/logging.rst:385 +#: ../../library/logging.rst:389 msgid "``INFO``" msgstr "``INFO``" -#: ../../library/logging.rst:385 +#: ../../library/logging.rst:389 msgid "20" msgstr "20" -#: ../../library/logging.rst:387 +#: ../../library/logging.rst:391 msgid "``DEBUG``" msgstr "``DEBUG``" -#: ../../library/logging.rst:387 +#: ../../library/logging.rst:391 msgid "10" msgstr "10" -#: ../../library/logging.rst:389 +#: ../../library/logging.rst:393 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../library/logging.rst:389 +#: ../../library/logging.rst:393 msgid "0" msgstr "0" -#: ../../library/logging.rst:396 +#: ../../library/logging.rst:400 msgid "Handler Objects" msgstr "" -#: ../../library/logging.rst:398 +#: ../../library/logging.rst:402 msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " @@ -551,53 +558,53 @@ msgid "" "to call :meth:`Handler.__init__`." msgstr "" -#: ../../library/logging.rst:407 +#: ../../library/logging.rst:411 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " "list of filters to the empty list and creating a lock (using :meth:" "`createLock`) for serializing access to an I/O mechanism." msgstr "" -#: ../../library/logging.rst:414 +#: ../../library/logging.rst:418 msgid "" "Initializes a thread lock which can be used to serialize access to " "underlying I/O functionality which may not be threadsafe." msgstr "" -#: ../../library/logging.rst:420 +#: ../../library/logging.rst:424 msgid "Acquires the thread lock created with :meth:`createLock`." msgstr "" -#: ../../library/logging.rst:425 +#: ../../library/logging.rst:429 msgid "Releases the thread lock acquired with :meth:`acquire`." msgstr "" -#: ../../library/logging.rst:430 +#: ../../library/logging.rst:434 msgid "" "Sets the threshold for this handler to *level*. Logging messages which are " "less severe than *level* will be ignored. When a handler is created, the " "level is set to :const:`NOTSET` (which causes all messages to be processed)." msgstr "" -#: ../../library/logging.rst:437 +#: ../../library/logging.rst:441 msgid "" "The *level* parameter now accepts a string representation of the level such " "as 'INFO' as an alternative to the integer constants such as :const:`INFO`." msgstr "" -#: ../../library/logging.rst:445 +#: ../../library/logging.rst:449 msgid "Sets the :class:`Formatter` for this handler to *fmt*." msgstr "" -#: ../../library/logging.rst:450 +#: ../../library/logging.rst:454 msgid "Adds the specified filter *filter* to this handler." msgstr "" -#: ../../library/logging.rst:455 +#: ../../library/logging.rst:459 msgid "Removes the specified filter *filter* from this handler." msgstr "" -#: ../../library/logging.rst:460 +#: ../../library/logging.rst:464 msgid "" "Apply this handler's filters to the record and return ``True`` if the record " "is to be processed. The filters are consulted in turn, until one of them " @@ -606,13 +613,13 @@ msgid "" "record." msgstr "" -#: ../../library/logging.rst:469 +#: ../../library/logging.rst:473 msgid "" "Ensure all logging output has been flushed. This version does nothing and is " "intended to be implemented by subclasses." msgstr "" -#: ../../library/logging.rst:475 +#: ../../library/logging.rst:479 msgid "" "Tidy up any resources used by the handler. This version does no output but " "removes the handler from an internal list of handlers which is closed when :" @@ -620,14 +627,14 @@ msgid "" "from overridden :meth:`close` methods." msgstr "" -#: ../../library/logging.rst:483 +#: ../../library/logging.rst:487 msgid "" "Conditionally emits the specified logging record, depending on filters which " "may have been added to the handler. Wraps the actual emission of the record " "with acquisition/release of the I/O thread lock." msgstr "" -#: ../../library/logging.rst:490 +#: ../../library/logging.rst:494 msgid "" "This method should be called from handlers when an exception is encountered " "during an :meth:`emit` call. If the module-level attribute " @@ -640,29 +647,29 @@ msgid "" "more useful during development)." msgstr "" -#: ../../library/logging.rst:503 +#: ../../library/logging.rst:507 msgid "" "Do formatting for a record - if a formatter is set, use it. Otherwise, use " "the default formatter for the module." msgstr "" -#: ../../library/logging.rst:509 +#: ../../library/logging.rst:513 msgid "" "Do whatever it takes to actually log the specified logging record. This " "version is intended to be implemented by subclasses and so raises a :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/logging.rst:513 +#: ../../library/logging.rst:517 msgid "" "For a list of handlers included as standard, see :mod:`logging.handlers`." msgstr "" -#: ../../library/logging.rst:518 +#: ../../library/logging.rst:522 msgid "Formatter Objects" msgstr "" -#: ../../library/logging.rst:522 +#: ../../library/logging.rst:526 msgid "" ":class:`Formatter` objects have the following attributes and methods. They " "are responsible for converting a :class:`LogRecord` to (usually) a string " @@ -673,7 +680,7 @@ msgid "" "information in the formatted output (such as a timestamp), keep reading." msgstr "" -#: ../../library/logging.rst:530 +#: ../../library/logging.rst:534 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 " @@ -683,13 +690,13 @@ msgid "" "ref:`old-string-formatting` for more information on string formatting." msgstr "" -#: ../../library/logging.rst:537 +#: ../../library/logging.rst:541 msgid "" "The useful mapping keys in a :class:`LogRecord` are given in the section on :" "ref:`logrecord-attributes`." msgstr "" -#: ../../library/logging.rst:543 +#: ../../library/logging.rst:547 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 " @@ -698,7 +705,7 @@ msgid "" "format is used which is described in the :meth:`formatTime` documentation." msgstr "" -#: ../../library/logging.rst:549 +#: ../../library/logging.rst:553 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:" @@ -708,29 +715,29 @@ msgid "" "for more information on using {- and $-formatting for log messages." msgstr "" -#: ../../library/logging.rst:557 +#: ../../library/logging.rst:561 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:561 +#: ../../library/logging.rst:565 msgid "The *style* parameter was added." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:564 +#: ../../library/logging.rst:568 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:569 +#: ../../library/logging.rst:573 msgid "The *defaults* parameter was added." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:574 +#: ../../library/logging.rst:578 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " @@ -749,13 +756,13 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:590 +#: ../../library/logging.rst:594 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:596 +#: ../../library/logging.rst:600 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 " @@ -768,7 +775,7 @@ msgid "" "resulting string is returned." msgstr "" -#: ../../library/logging.rst:606 +#: ../../library/logging.rst:610 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 " @@ -778,7 +785,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:614 +#: ../../library/logging.rst:618 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 " @@ -793,11 +800,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:627 +#: ../../library/logging.rst:631 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:632 +#: ../../library/logging.rst:636 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -805,18 +812,18 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:639 +#: ../../library/logging.rst:643 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:646 +#: ../../library/logging.rst:650 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:648 +#: ../../library/logging.rst:652 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -826,7 +833,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:658 +#: ../../library/logging.rst:662 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 " @@ -834,13 +841,13 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:665 +#: ../../library/logging.rst:669 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:669 +#: ../../library/logging.rst:673 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -850,13 +857,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:676 +#: ../../library/logging.rst:680 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:679 +#: ../../library/logging.rst:683 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) " @@ -867,7 +874,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:689 +#: ../../library/logging.rst:693 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -879,11 +886,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:701 +#: ../../library/logging.rst:705 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:703 +#: ../../library/logging.rst:707 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -891,11 +898,11 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:711 +#: ../../library/logging.rst:715 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:713 +#: ../../library/logging.rst:717 msgid "" "The primary information is passed in :attr:`msg` and :attr:`args`, which are " "combined using ``msg % args`` to create the :attr:`message` field of the " @@ -906,58 +913,58 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:717 +#: ../../library/logging.rst:721 msgid "" "The name of the logger used to log the event represented by this LogRecord. " "Note that this name will always have this value, even though it may be " "emitted by a handler attached to a different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:721 +#: ../../library/logging.rst:725 msgid "" "The numeric level of the logging event (one of DEBUG, INFO etc.) Note that " "this is converted to *two* attributes of the LogRecord: ``levelno`` for the " "numeric value and ``levelname`` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:725 +#: ../../library/logging.rst:729 msgid "The full pathname of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:727 +#: ../../library/logging.rst:731 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:729 +#: ../../library/logging.rst:733 msgid "" "The event description message, possibly a format string with placeholders " "for variable data." msgstr "" -#: ../../library/logging.rst:731 +#: ../../library/logging.rst:735 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:733 +#: ../../library/logging.rst:737 msgid "" "An exception tuple with the current exception information, or ``None`` if no " "exception information is available." msgstr "" -#: ../../library/logging.rst:735 +#: ../../library/logging.rst:739 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:737 +#: ../../library/logging.rst:741 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:742 +#: ../../library/logging.rst:746 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -966,7 +973,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:749 +#: ../../library/logging.rst:753 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 " @@ -974,24 +981,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:755 +#: ../../library/logging.rst:759 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:767 +#: ../../library/logging.rst:771 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:776 +#: ../../library/logging.rst:780 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:778 +#: ../../library/logging.rst:782 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 " @@ -1002,7 +1009,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:786 +#: ../../library/logging.rst:790 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 (:" @@ -1010,7 +1017,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:792 +#: ../../library/logging.rst:796 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: " @@ -1019,308 +1026,308 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:799 +#: ../../library/logging.rst:803 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:799 ../../library/logging.rst:1178 +#: ../../library/logging.rst:803 ../../library/logging.rst:1186 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:799 ../../library/logging.rst:1178 +#: ../../library/logging.rst:803 ../../library/logging.rst:1186 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:801 ../../library/logging.rst:0 +#: ../../library/logging.rst:0 ../../library/logging.rst:805 msgid "args" msgstr "" -#: ../../library/logging.rst:801 ../../library/logging.rst:815 -#: ../../library/logging.rst:843 ../../library/logging.rst:861 +#: ../../library/logging.rst:805 ../../library/logging.rst:819 +#: ../../library/logging.rst:847 ../../library/logging.rst:865 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:801 +#: ../../library/logging.rst:805 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:806 +#: ../../library/logging.rst:810 msgid "asctime" msgstr "" -#: ../../library/logging.rst:806 +#: ../../library/logging.rst:810 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:806 +#: ../../library/logging.rst:810 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:812 +#: ../../library/logging.rst:816 msgid "created" msgstr "" -#: ../../library/logging.rst:812 +#: ../../library/logging.rst:816 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:812 +#: ../../library/logging.rst:816 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:815 ../../library/logging.rst:0 +#: ../../library/logging.rst:0 ../../library/logging.rst:819 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:815 +#: ../../library/logging.rst:819 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:818 +#: ../../library/logging.rst:822 msgid "filename" msgstr "" -#: ../../library/logging.rst:818 +#: ../../library/logging.rst:822 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:818 +#: ../../library/logging.rst:822 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:820 +#: ../../library/logging.rst:824 msgid "funcName" msgstr "" -#: ../../library/logging.rst:820 +#: ../../library/logging.rst:824 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:820 +#: ../../library/logging.rst:824 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:826 msgid "levelname" msgstr "" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:826 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:826 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:826 +#: ../../library/logging.rst:830 msgid "levelno" msgstr "" -#: ../../library/logging.rst:826 +#: ../../library/logging.rst:830 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:826 +#: ../../library/logging.rst:830 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:831 +#: ../../library/logging.rst:835 msgid "lineno" msgstr "" -#: ../../library/logging.rst:831 +#: ../../library/logging.rst:835 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:831 +#: ../../library/logging.rst:835 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:834 +#: ../../library/logging.rst:838 msgid "message" msgstr "" -#: ../../library/logging.rst:834 +#: ../../library/logging.rst:838 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:834 +#: ../../library/logging.rst:838 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:842 msgid "module" msgstr "模組" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:842 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:838 +#: ../../library/logging.rst:842 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:844 msgid "msecs" msgstr "" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:844 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:840 +#: ../../library/logging.rst:844 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:843 ../../library/logging.rst:0 +#: ../../library/logging.rst:0 ../../library/logging.rst:847 msgid "msg" msgstr "" -#: ../../library/logging.rst:843 +#: ../../library/logging.rst:847 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:848 ../../library/logging.rst:0 +#: ../../library/logging.rst:0 ../../library/logging.rst:852 msgid "name" msgstr "" -#: ../../library/logging.rst:848 +#: ../../library/logging.rst:852 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:848 +#: ../../library/logging.rst:852 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:854 msgid "pathname" msgstr "" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:854 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:854 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:857 msgid "process" msgstr "" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:857 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:857 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:859 msgid "processName" msgstr "" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:859 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:859 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:861 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:861 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:861 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:865 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:865 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:867 +#: ../../library/logging.rst:871 msgid "thread" msgstr "" -#: ../../library/logging.rst:867 +#: ../../library/logging.rst:871 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:867 +#: ../../library/logging.rst:871 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:873 msgid "threadName" msgstr "" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:873 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:873 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:872 +#: ../../library/logging.rst:876 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:879 +#: ../../library/logging.rst:883 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:881 +#: ../../library/logging.rst:885 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:887 +#: ../../library/logging.rst:891 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:896 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1329,7 +1336,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:902 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1341,24 +1348,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:911 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:912 +#: ../../library/logging.rst:916 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:918 +#: ../../library/logging.rst:922 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:924 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 " @@ -1367,7 +1374,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:925 +#: ../../library/logging.rst:929 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 " @@ -1375,17 +1382,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:936 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:934 +#: ../../library/logging.rst:938 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:940 +#: ../../library/logging.rst:944 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 " @@ -1394,14 +1401,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:945 +#: ../../library/logging.rst:949 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:952 +#: ../../library/logging.rst:956 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 " @@ -1410,24 +1417,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:963 +#: ../../library/logging.rst:967 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:965 +#: ../../library/logging.rst:969 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:970 +#: ../../library/logging.rst:974 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:975 +#: ../../library/logging.rst:979 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 " @@ -1436,7 +1443,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:980 +#: ../../library/logging.rst:984 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1446,7 +1453,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1006 +#: ../../library/logging.rst:1010 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 " @@ -1455,11 +1462,11 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1017 +#: ../../library/logging.rst:1021 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1031 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:" @@ -1470,51 +1477,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1045 +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:1054 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1060 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1055 +#: ../../library/logging.rst:1063 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:1062 +#: ../../library/logging.rst:1070 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1068 +#: ../../library/logging.rst:1076 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1074 +#: ../../library/logging.rst:1082 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:1080 +#: ../../library/logging.rst:1088 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1085 +#: ../../library/logging.rst:1093 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 " @@ -1528,7 +1542,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1096 +#: ../../library/logging.rst:1104 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 " @@ -1536,13 +1550,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1101 +#: ../../library/logging.rst:1109 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1107 +#: ../../library/logging.rst:1115 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1552,17 +1566,17 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1114 +#: ../../library/logging.rst:1122 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1119 +#: ../../library/logging.rst:1127 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1121 +#: ../../library/logging.rst:1129 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1572,20 +1586,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1128 +#: ../../library/logging.rst:1136 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:1132 +#: ../../library/logging.rst:1140 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1135 +#: ../../library/logging.rst:1143 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 " @@ -1594,7 +1608,7 @@ msgid "" "versa." msgstr "" -#: ../../library/logging.rst:1141 +#: ../../library/logging.rst:1149 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. " @@ -1602,7 +1616,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1149 +#: ../../library/logging.rst:1157 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1610,7 +1624,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1157 +#: ../../library/logging.rst:1165 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1619,13 +1633,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1163 +#: ../../library/logging.rst:1171 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:1166 +#: ../../library/logging.rst:1174 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 " @@ -1634,54 +1648,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1173 +#: ../../library/logging.rst:1181 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1188 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1188 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1184 +#: ../../library/logging.rst:1192 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1184 +#: ../../library/logging.rst:1192 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1188 +#: ../../library/logging.rst:1196 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1188 +#: ../../library/logging.rst:1196 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1193 +#: ../../library/logging.rst:1201 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1193 +#: ../../library/logging.rst:1201 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1204 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1204 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1207 +#: ../../library/logging.rst:1215 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1207 +#: ../../library/logging.rst:1215 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:1213 +#: ../../library/logging.rst:1221 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1213 +#: ../../library/logging.rst:1221 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 " @@ -1721,33 +1735,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1222 +#: ../../library/logging.rst:1230 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1222 +#: ../../library/logging.rst:1230 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:1228 +#: ../../library/logging.rst:1236 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1228 +#: ../../library/logging.rst:1236 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:1233 +#: ../../library/logging.rst:1241 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1233 +#: ../../library/logging.rst:1241 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 " @@ -1756,39 +1770,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1244 +#: ../../library/logging.rst:1252 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1247 +#: ../../library/logging.rst:1255 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:1253 +#: ../../library/logging.rst:1261 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1256 +#: ../../library/logging.rst:1264 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1261 +#: ../../library/logging.rst:1269 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:1265 +#: ../../library/logging.rst:1273 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:1272 +#: ../../library/logging.rst:1280 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 " @@ -1800,32 +1814,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1283 +#: ../../library/logging.rst:1291 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1293 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1287 +#: ../../library/logging.rst:1295 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:1292 +#: ../../library/logging.rst:1300 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1294 +#: ../../library/logging.rst:1302 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1296 +#: ../../library/logging.rst:1304 msgid "The logger name." msgstr "" @@ -1833,7 +1847,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1297 +#: ../../library/logging.rst:1305 msgid "The logging level (numeric)." msgstr "" @@ -1841,7 +1855,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1298 +#: ../../library/logging.rst:1306 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1849,19 +1863,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1307 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1308 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1301 +#: ../../library/logging.rst:1309 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1302 +#: ../../library/logging.rst:1310 msgid "An exception tuple, or ``None``." msgstr "" @@ -1869,7 +1883,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1303 +#: ../../library/logging.rst:1311 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1877,7 +1891,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1305 +#: ../../library/logging.rst:1313 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1887,15 +1901,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1315 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1319 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1323 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``, " @@ -1906,22 +1920,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1326 +#: ../../library/logging.rst:1334 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1328 +#: ../../library/logging.rst:1336 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1341 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1344 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -1930,46 +1944,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1349 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:1349 +#: ../../library/logging.rst:1357 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1357 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1360 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1360 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1356 +#: ../../library/logging.rst:1364 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1355 +#: ../../library/logging.rst:1363 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1361 +#: ../../library/logging.rst:1369 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1359 +#: ../../library/logging.rst:1367 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/re.po b/library/re.po index 91236d1b44..601ca7659e 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-05-24 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -145,7 +145,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1419 +#: ../../library/re.rst:104 ../../library/re.rst:1431 msgid "``.``" msgstr "``.``" @@ -853,53 +853,17 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:605 -msgid "" -"Flag constants are now instances of :class:`RegexFlag`, which is a subclass " -"of :class:`enum.IntFlag`." -msgstr "" - -#: ../../library/re.rst:611 -msgid "" -"Compile a regular expression pattern into a :ref:`regular expression object " -"`, which can be used for matching using its :func:`~Pattern." -"match`, :func:`~Pattern.search` and other methods, described below." +#: ../../library/re.rst:607 +msgid "Flags" msgstr "" -#: ../../library/re.rst:616 +#: ../../library/re.rst:609 msgid "" -"The expression's behaviour can be modified by specifying a *flags* value. " -"Values can be any of the following variables, combined using bitwise OR (the " -"``|`` operator)." -msgstr "" - -#: ../../library/re.rst:620 -msgid "The sequence ::" -msgstr "" - -#: ../../library/re.rst:625 -msgid "is equivalent to ::" -msgstr "" -"等價於:\n" -"\n" -"::" - -#: ../../library/re.rst:629 -msgid "" -"but using :func:`re.compile` and saving the resulting regular expression " -"object for reuse is more efficient when the expression will be used several " -"times in a single program." -msgstr "" - -#: ../../library/re.rst:635 -msgid "" -"The compiled versions of the most recent patterns passed to :func:`re." -"compile` and the module-level matching functions are cached, so programs " -"that use only a few regular expressions at a time needn't worry about " -"compiling regular expressions." +"Flag constants are now instances of :class:`RegexFlag`, which is a subclass " +"of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:644 +#: ../../library/re.rst:618 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and ``" "\\S`` perform ASCII-only matching instead of full Unicode matching. This is " @@ -907,7 +871,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:649 +#: ../../library/re.rst:623 msgid "" "Note that for backward compatibility, the :const:`re.U` flag still exists " "(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?" @@ -915,13 +879,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:658 +#: ../../library/re.rst:632 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:665 +#: ../../library/re.rst:639 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -931,7 +895,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:672 +#: ../../library/re.rst:646 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -942,7 +906,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:683 +#: ../../library/re.rst:657 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -953,20 +917,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:692 +#: ../../library/re.rst:666 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:696 +#: ../../library/re.rst:670 msgid "" "Compiled regular expression objects with the :const:`re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: ../../library/re.rst:705 +#: ../../library/re.rst:679 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -977,14 +941,14 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:717 +#: ../../library/re.rst:691 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline. " "Corresponds to the inline flag ``(?s)``." msgstr "" -#: ../../library/re.rst:727 +#: ../../library/re.rst:701 msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " @@ -996,17 +960,61 @@ msgid "" "the line are ignored." msgstr "" -#: ../../library/re.rst:736 +#: ../../library/re.rst:710 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:744 +#: ../../library/re.rst:718 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:749 +#: ../../library/re.rst:722 +msgid "Functions" +msgstr "" + +#: ../../library/re.rst:726 +msgid "" +"Compile a regular expression pattern into a :ref:`regular expression object " +"`, which can be used for matching using its :func:`~Pattern." +"match`, :func:`~Pattern.search` and other methods, described below." +msgstr "" + +#: ../../library/re.rst:731 +msgid "" +"The expression's behaviour can be modified by specifying a *flags* value. " +"Values can be any of the following variables, combined using bitwise OR (the " +"``|`` operator)." +msgstr "" + +#: ../../library/re.rst:735 +msgid "The sequence ::" +msgstr "" + +#: ../../library/re.rst:740 +msgid "is equivalent to ::" +msgstr "" +"等價於:\n" +"\n" +"::" + +#: ../../library/re.rst:744 +msgid "" +"but using :func:`re.compile` and saving the resulting regular expression " +"object for reuse is more efficient when the expression will be used several " +"times in a single program." +msgstr "" + +#: ../../library/re.rst:750 +msgid "" +"The compiled versions of the most recent patterns passed to :func:`re." +"compile` and the module-level matching functions are cached, so programs " +"that use only a few regular expressions at a time needn't worry about " +"compiling regular expressions." +msgstr "" + +#: ../../library/re.rst:758 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1015,7 +1023,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:758 +#: ../../library/re.rst:767 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the " @@ -1043,7 +1051,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:782 +#: ../../library/re.rst:791 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1052,42 +1060,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:797 +#: ../../library/re.rst:806 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:804 +#: ../../library/re.rst:813 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:807 +#: ../../library/re.rst:816 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:817 ../../library/re.rst:907 ../../library/re.rst:931 +#: ../../library/re.rst:826 ../../library/re.rst:916 ../../library/re.rst:940 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:820 +#: ../../library/re.rst:829 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:826 +#: ../../library/re.rst:835 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:830 +#: ../../library/re.rst:839 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1097,11 +1105,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:842 ../../library/re.rst:853 +#: ../../library/re.rst:851 ../../library/re.rst:862 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:848 +#: ../../library/re.rst:857 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1109,7 +1117,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:859 +#: ../../library/re.rst:868 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1123,18 +1131,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:875 +#: ../../library/re.rst:884 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:887 +#: ../../library/re.rst:896 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:889 +#: ../../library/re.rst:898 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1143,7 +1151,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:897 +#: ../../library/re.rst:906 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1156,52 +1164,52 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:910 ../../library/re.rst:934 ../../library/re.rst:1165 +#: ../../library/re.rst:919 ../../library/re.rst:943 ../../library/re.rst:1177 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:913 +#: ../../library/re.rst:922 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:917 +#: ../../library/re.rst:926 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:921 +#: ../../library/re.rst:930 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:928 +#: ../../library/re.rst:937 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:940 +#: ../../library/re.rst:949 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:955 +#: ../../library/re.rst:964 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:963 +#: ../../library/re.rst:972 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:966 +#: ../../library/re.rst:975 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1209,11 +1217,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:975 +#: ../../library/re.rst:984 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:980 +#: ../../library/re.rst:988 +msgid "Exceptions" +msgstr "" + +#: ../../library/re.rst:992 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1222,41 +1234,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:988 +#: ../../library/re.rst:1000 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:992 +#: ../../library/re.rst:1004 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:996 +#: ../../library/re.rst:1008 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1000 +#: ../../library/re.rst:1012 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1004 +#: ../../library/re.rst:1016 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1006 +#: ../../library/re.rst:1018 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1012 +#: ../../library/re.rst:1024 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1014 +#: ../../library/re.rst:1026 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1019 +#: ../../library/re.rst:1031 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1265,7 +1277,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1025 +#: ../../library/re.rst:1037 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1274,7 +1286,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1031 +#: ../../library/re.rst:1043 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1284,7 +1296,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1046 +#: ../../library/re.rst:1058 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1292,19 +1304,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1051 ../../library/re.rst:1069 +#: ../../library/re.rst:1063 ../../library/re.rst:1081 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1059 +#: ../../library/re.rst:1071 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1065 +#: ../../library/re.rst:1077 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1312,76 +1324,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1083 +#: ../../library/re.rst:1095 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1088 +#: ../../library/re.rst:1100 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1095 +#: ../../library/re.rst:1107 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1102 +#: ../../library/re.rst:1114 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1107 +#: ../../library/re.rst:1119 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1112 +#: ../../library/re.rst:1124 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1119 +#: ../../library/re.rst:1131 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1136 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1131 +#: ../../library/re.rst:1143 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1134 +#: ../../library/re.rst:1146 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1142 +#: ../../library/re.rst:1154 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1144 +#: ../../library/re.rst:1156 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1153 +#: ../../library/re.rst:1165 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1158 +#: ../../library/re.rst:1170 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1390,7 +1402,7 @@ msgid "" "\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1170 +#: ../../library/re.rst:1182 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1405,7 +1417,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1192 +#: ../../library/re.rst:1204 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1413,53 +1425,53 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1197 +#: ../../library/re.rst:1209 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1205 +#: ../../library/re.rst:1217 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1212 +#: ../../library/re.rst:1224 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1221 +#: ../../library/re.rst:1233 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1237 +#: ../../library/re.rst:1249 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1241 ../../library/re.rst:1463 +#: ../../library/re.rst:1253 ../../library/re.rst:1475 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1247 +#: ../../library/re.rst:1259 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1260 +#: ../../library/re.rst:1272 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1272 +#: ../../library/re.rst:1284 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1468,7 +1480,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1280 +#: ../../library/re.rst:1292 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1476,32 +1488,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1285 +#: ../../library/re.rst:1297 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1295 +#: ../../library/re.rst:1307 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1302 +#: ../../library/re.rst:1314 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1309 +#: ../../library/re.rst:1321 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1316 +#: ../../library/re.rst:1328 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1510,43 +1522,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1325 +#: ../../library/re.rst:1337 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1331 +#: ../../library/re.rst:1343 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1337 +#: ../../library/re.rst:1349 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1340 +#: ../../library/re.rst:1352 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1348 +#: ../../library/re.rst:1360 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1352 +#: ../../library/re.rst:1364 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1354 +#: ../../library/re.rst:1366 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1362 +#: ../../library/re.rst:1374 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1554,28 +1566,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1367 +#: ../../library/re.rst:1379 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1377 +#: ../../library/re.rst:1389 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1387 +#: ../../library/re.rst:1399 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1406 +#: ../../library/re.rst:1418 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1410 +#: ../../library/re.rst:1422 msgid "" "Python does not currently have an equivalent to :c:func:`scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1584,99 +1596,99 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1417 +#: ../../library/re.rst:1429 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1417 +#: ../../library/re.rst:1429 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1419 +#: ../../library/re.rst:1431 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1421 +#: ../../library/re.rst:1433 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1421 +#: ../../library/re.rst:1433 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1423 +#: ../../library/re.rst:1435 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1423 +#: ../../library/re.rst:1435 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1425 +#: ../../library/re.rst:1437 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1425 +#: ../../library/re.rst:1437 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1427 +#: ../../library/re.rst:1439 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1427 +#: ../../library/re.rst:1439 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1429 +#: ../../library/re.rst:1441 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1429 +#: ../../library/re.rst:1441 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1431 +#: ../../library/re.rst:1443 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1431 +#: ../../library/re.rst:1443 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1433 +#: ../../library/re.rst:1445 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1433 +#: ../../library/re.rst:1445 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1447 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1447 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1438 +#: ../../library/re.rst:1450 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1442 +#: ../../library/re.rst:1454 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1446 +#: ../../library/re.rst:1458 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1454 +#: ../../library/re.rst:1466 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1458 +#: ../../library/re.rst:1470 msgid "" "Python offers two different primitive operations based on regular " "expressions: :func:`re.match` checks for a match only at the beginning of " @@ -1684,13 +1696,13 @@ msgid "" "string (this is what Perl does by default)." msgstr "" -#: ../../library/re.rst:1469 +#: ../../library/re.rst:1481 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1477 +#: ../../library/re.rst:1489 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1698,11 +1710,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1487 +#: ../../library/re.rst:1499 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1489 +#: ../../library/re.rst:1501 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1710,37 +1722,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1494 +#: ../../library/re.rst:1506 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1507 +#: ../../library/re.rst:1519 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1520 +#: ../../library/re.rst:1532 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1533 +#: ../../library/re.rst:1545 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1548 +#: ../../library/re.rst:1560 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1550 +#: ../../library/re.rst:1562 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1748,11 +1760,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1567 +#: ../../library/re.rst:1579 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1569 +#: ../../library/re.rst:1581 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1760,11 +1772,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1580 +#: ../../library/re.rst:1592 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1582 +#: ../../library/re.rst:1594 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1773,11 +1785,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1596 +#: ../../library/re.rst:1608 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1598 +#: ../../library/re.rst:1610 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1785,7 +1797,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1608 +#: ../../library/re.rst:1620 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1793,29 +1805,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1620 +#: ../../library/re.rst:1632 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1622 +#: ../../library/re.rst:1634 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1626 +#: ../../library/re.rst:1638 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1682 +#: ../../library/re.rst:1694 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1705 +#: ../../library/re.rst:1717 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " diff --git a/library/test.po b/library/test.po index 283036b583..b327874f61 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-05-28 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -417,60 +417,72 @@ msgstr "" #: ../../library/test.rst:362 msgid "" -"Return ``True`` if running on CPython, not on Windows, and configuration not " -"set with ``WITH_DOC_STRINGS``." +"Set to ``True`` if Python is built without docstrings (the :c:macro:" +"`WITH_DOC_STRINGS` macro is not defined). See the :option:`configure --" +"without-doc-strings <--without-doc-strings>` option." msgstr "" -#: ../../library/test.rst:368 -msgid "Check for presence of docstrings." +#: ../../library/test.rst:366 +msgid "See also the :data:`HAVE_DOCSTRINGS` variable." msgstr "" -#: ../../library/test.rst:373 +#: ../../library/test.rst:371 +msgid "" +"Set to ``True`` if function docstrings are available. See the :option:" +"`python -OO <-O>` option, which strips docstrings of functions implemented " +"in Python." +msgstr "" + +#: ../../library/test.rst:374 +msgid "See also the :data:`MISSING_C_DOCSTRINGS` variable." +msgstr "" + +#: ../../library/test.rst:379 msgid "Define the URL of a dedicated HTTP server for the network tests." msgstr "" -#: ../../library/test.rst:378 +#: ../../library/test.rst:384 msgid "Object that is equal to anything. Used to test mixed type comparison." msgstr "" -#: ../../library/test.rst:383 +#: ../../library/test.rst:389 msgid "" "Object that is not equal to anything (even to :data:`ALWAYS_EQ`). Used to " "test mixed type comparison." msgstr "" -#: ../../library/test.rst:389 +#: ../../library/test.rst:395 msgid "" "Object that is greater than anything (except itself). Used to test mixed " "type comparison." msgstr "" -#: ../../library/test.rst:395 +#: ../../library/test.rst:401 msgid "" "Object that is less than anything (except itself). Used to test mixed type " "comparison." msgstr "" -#: ../../library/test.rst:399 +#: ../../library/test.rst:405 msgid "The :mod:`test.support` module defines the following functions:" msgstr "" -#: ../../library/test.rst:403 +#: ../../library/test.rst:409 msgid "" "Return ``True`` if *resource* is enabled and available. The list of " "available resources is only set when :mod:`test.regrtest` is executing the " "tests." msgstr "" -#: ../../library/test.rst:410 +#: ../../library/test.rst:416 msgid "Return ``True`` if Python was not built with ``-O0`` or ``-Og``." msgstr "" -#: ../../library/test.rst:415 +#: ../../library/test.rst:421 msgid "Return :data:`_testcapi.WITH_PYMALLOC`." msgstr "" -#: ../../library/test.rst:420 +#: ../../library/test.rst:426 msgid "" "Raise :exc:`ResourceDenied` if *resource* is not available. *msg* is the " "argument to :exc:`ResourceDenied` if it is raised. Always returns ``True`` " @@ -478,44 +490,42 @@ msgid "" "tests are executed by :mod:`test.regrtest`." msgstr "" -#: ../../library/test.rst:428 -msgid "" -"Raise :exc:`unittest.SkipTest` on TLS certification validation failures." -msgstr "" - -#: ../../library/test.rst:433 +#: ../../library/test.rst:434 msgid "Return a repr of *dict* with keys sorted." msgstr "" -#: ../../library/test.rst:438 +#: ../../library/test.rst:439 msgid "" "Return the path to the file named *filename*. If no match is found " "*filename* is returned. This does not equal a failure since it could be the " "path to the file." msgstr "" -#: ../../library/test.rst:442 +#: ../../library/test.rst:443 msgid "" "Setting *subdir* indicates a relative path to use to find the file rather " "than looking directly in the path directories." msgstr "" -#: ../../library/test.rst:448 -msgid "Match *test* to patterns set in :func:`set_match_tests`." +#: ../../library/test.rst:449 +msgid "" +"Determine whether *test* matches the patterns set in :func:`set_match_tests`." msgstr "" -#: ../../library/test.rst:453 -msgid "Define match test with regular expression *patterns*." +#: ../../library/test.rst:454 +msgid "" +"Define match patterns on test filenames and test method names for filtering " +"tests." msgstr "" -#: ../../library/test.rst:458 +#: ../../library/test.rst:459 msgid "" "Execute :class:`unittest.TestCase` subclasses passed to the function. The " "function scans the classes for methods starting with the prefix ``test_`` " "and executes the tests individually." msgstr "" -#: ../../library/test.rst:462 +#: ../../library/test.rst:463 msgid "" "It is also legal to pass strings as parameters; these should be keys in " "``sys.modules``. Each associated module will be scanned by ``unittest." @@ -523,17 +533,17 @@ msgid "" "func:`test_main` function::" msgstr "" -#: ../../library/test.rst:470 +#: ../../library/test.rst:471 msgid "This will run all tests defined in the named module." msgstr "" -#: ../../library/test.rst:475 +#: ../../library/test.rst:476 msgid "" "Run :func:`doctest.testmod` on the given *module*. Return ``(failure_count, " "test_count)``." msgstr "" -#: ../../library/test.rst:478 +#: ../../library/test.rst:479 msgid "" "If *verbosity* is ``None``, :func:`doctest.testmod` is run with verbosity " "set to :data:`verbose`. Otherwise, it is run with verbosity set to " @@ -541,67 +551,68 @@ msgid "" "testmod`." msgstr "" -#: ../../library/test.rst:486 +#: ../../library/test.rst:487 msgid "" "Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a " "minimum interval for Android systems to prevent the system from hanging." msgstr "" -#: ../../library/test.rst:492 +#: ../../library/test.rst:493 msgid "" "Use this check to guard CPython's implementation-specific tests or to run " -"them only on the implementations guarded by the arguments::" +"them only on the implementations guarded by the arguments. This function " +"returns ``True`` or ``False`` depending on the host platform. Example usage::" msgstr "" -#: ../../library/test.rst:502 +#: ../../library/test.rst:505 msgid "" "Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big " "memory tests." msgstr "" -#: ../../library/test.rst:508 +#: ../../library/test.rst:511 msgid "" "Store the value from *stdout*. It is meant to hold the stdout at the time " "the regrtest began." msgstr "" -#: ../../library/test.rst:514 +#: ../../library/test.rst:517 msgid "" "Return the original stdout set by :func:`record_original_stdout` or ``sys." "stdout`` if it's not set." msgstr "" -#: ../../library/test.rst:520 +#: ../../library/test.rst:523 msgid "" "Return a list of command line arguments reproducing the current settings in " "``sys.flags`` and ``sys.warnoptions``." msgstr "" -#: ../../library/test.rst:526 +#: ../../library/test.rst:529 msgid "" "Return a list of command line arguments reproducing the current optimization " "settings in ``sys.flags``." msgstr "" -#: ../../library/test.rst:534 +#: ../../library/test.rst:537 msgid "" "A context managers that temporarily replaces the named stream with :class:" "`io.StringIO` object." msgstr "" -#: ../../library/test.rst:537 +#: ../../library/test.rst:540 msgid "Example use with output streams::" msgstr "" -#: ../../library/test.rst:545 +#: ../../library/test.rst:548 msgid "Example use with input stream::" msgstr "" -#: ../../library/test.rst:557 -msgid "A context manager that replaces ``sys.stderr`` with ``sys.__stderr__``." +#: ../../library/test.rst:560 +msgid "A context manager that temporary disables :mod:`faulthandler`." msgstr "" -#: ../../library/test.rst:562 +#: ../../library/test.rst:565 msgid "" "Force as many objects as possible to be collected. This is needed because " "timely deallocation is not guaranteed by the garbage collector. This means " @@ -609,100 +620,108 @@ msgid "" "remain alive for longer than expected." msgstr "" -#: ../../library/test.rst:570 +#: ../../library/test.rst:573 msgid "" -"A context manager that disables the garbage collector upon entry and " -"reenables it upon exit." +"A context manager that disables the garbage collector on entry. On exit, the " +"garbage collector is restored to its prior state." msgstr "" -#: ../../library/test.rst:576 +#: ../../library/test.rst:579 msgid "Context manager to swap out an attribute with a new object." msgstr "" -#: ../../library/test.rst:578 ../../library/test.rst:596 -#: ../../library/test.rst:812 ../../library/test.rst:1263 +#: ../../library/test.rst:581 ../../library/test.rst:599 +#: ../../library/test.rst:819 ../../library/test.rst:1282 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/test.rst:583 +#: ../../library/test.rst:586 msgid "" "This will set ``obj.attr`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``attr`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:588 ../../library/test.rst:606 +#: ../../library/test.rst:591 ../../library/test.rst:609 msgid "" "The old value (or ``None`` if it doesn't exist) will be assigned to the " "target of the \"as\" clause, if there is one." msgstr "" -#: ../../library/test.rst:594 +#: ../../library/test.rst:597 msgid "Context manager to swap out an item with a new object." msgstr "" -#: ../../library/test.rst:601 +#: ../../library/test.rst:604 msgid "" "This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``item`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:612 +#: ../../library/test.rst:615 msgid "" "Print a warning into :data:`sys.__stderr__`. Format the message as: ``f" "\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add ``\"Warning " "-- \"`` prefix to each line." msgstr "" -#: ../../library/test.rst:621 +#: ../../library/test.rst:624 msgid "" "Wait until process *pid* completes and check that the process exit code is " "*exitcode*." msgstr "" -#: ../../library/test.rst:624 +#: ../../library/test.rst:627 msgid "" "Raise an :exc:`AssertionError` if the process exit code is not equal to " "*exitcode*." msgstr "" -#: ../../library/test.rst:627 +#: ../../library/test.rst:630 msgid "" "If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by " "default), kill the process and raise an :exc:`AssertionError`. The timeout " "feature is not available on Windows." msgstr "" -#: ../../library/test.rst:636 +#: ../../library/test.rst:639 msgid "" -"Return :func:`struct.calcsize` for ``nP{fmt}0n`` or, if ``gettotalrefcount`` " -"exists, ``2PnP{fmt}0P``." +"Return the size of the :c:type:`PyObject` whose structure members are " +"defined by *fmt*. The returned value includes the size of the Python object " +"header and alignment." msgstr "" -#: ../../library/test.rst:642 +#: ../../library/test.rst:645 msgid "" -"Return :func:`struct.calcsize` for ``nPn{fmt}0n`` or, if " -"``gettotalrefcount`` exists, ``2PnPn{fmt}0P``." +"Return the size of the :c:type:`PyVarObject` whose structure members are " +"defined by *fmt*. The returned value includes the size of the Python object " +"header and alignment." msgstr "" -#: ../../library/test.rst:648 +#: ../../library/test.rst:651 msgid "" "For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC " "header size equals *size*." msgstr "" -#: ../../library/test.rst:654 +#: ../../library/test.rst:657 msgid "" "A decorator to conditionally mark tests with :func:`unittest." "expectedFailure`. Any use of this decorator should have an associated " "comment identifying the relevant tracker issue." msgstr "" -#: ../../library/test.rst:661 +#: ../../library/test.rst:664 +msgid "" +"A decorator that skips the decorated test on TLS certification validation " +"failures." +msgstr "" + +#: ../../library/test.rst:669 msgid "" "A decorator for running a function in a different locale, correctly " "resetting it after it has finished. *catstr* is the locale category as a " @@ -710,73 +729,73 @@ msgid "" "sequentially, and the first valid locale will be used." msgstr "" -#: ../../library/test.rst:669 +#: ../../library/test.rst:677 msgid "" "A decorator for running a function in a specific timezone, correctly " "resetting it after it has finished." msgstr "" -#: ../../library/test.rst:675 +#: ../../library/test.rst:683 msgid "" "Decorator for the minimum version when running test on FreeBSD. If the " -"FreeBSD version is less than the minimum, raise :exc:`unittest.SkipTest`." +"FreeBSD version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:681 +#: ../../library/test.rst:689 msgid "" "Decorator for the minimum version when running test on Linux. If the Linux " -"version is less than the minimum, raise :exc:`unittest.SkipTest`." +"version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:687 +#: ../../library/test.rst:695 msgid "" "Decorator for the minimum version when running test on macOS. If the macOS " -"version is less than the minimum, raise :exc:`unittest.SkipTest`." +"version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:693 +#: ../../library/test.rst:701 msgid "Decorator for skipping tests on non-IEEE 754 platforms." msgstr "" -#: ../../library/test.rst:698 +#: ../../library/test.rst:706 msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." msgstr "" -#: ../../library/test.rst:703 +#: ../../library/test.rst:711 msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." msgstr "" -#: ../../library/test.rst:708 +#: ../../library/test.rst:716 msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." msgstr "" -#: ../../library/test.rst:713 +#: ../../library/test.rst:721 msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." msgstr "" -#: ../../library/test.rst:718 +#: ../../library/test.rst:726 msgid "Decorator for skipping tests if *resource* is not available." msgstr "" -#: ../../library/test.rst:723 +#: ../../library/test.rst:731 msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." msgstr "" -#: ../../library/test.rst:728 +#: ../../library/test.rst:736 msgid "Decorator for tests only applicable to CPython." msgstr "" -#: ../../library/test.rst:733 +#: ../../library/test.rst:741 msgid "" "Decorator for invoking :func:`check_impl_detail` on *guards*. If that " "returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" -#: ../../library/test.rst:739 +#: ../../library/test.rst:747 msgid "Decorator to temporarily turn off tracing for the duration of the test." msgstr "" -#: ../../library/test.rst:744 +#: ../../library/test.rst:752 msgid "" "Decorator for tests which involve reference counting. The decorator does " "not run the test if it is not run by CPython. Any trace function is unset " @@ -784,11 +803,11 @@ msgid "" "trace function." msgstr "" -#: ../../library/test.rst:752 +#: ../../library/test.rst:760 msgid "Decorator for bigmem tests." msgstr "" -#: ../../library/test.rst:754 +#: ../../library/test.rst:762 msgid "" "*size* is a requested size for the test (in arbitrary, test-interpreted " "units.) *memuse* is the number of bytes per unit for the test, or a good " @@ -796,7 +815,7 @@ msgid "" "each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" -#: ../../library/test.rst:759 +#: ../../library/test.rst:767 msgid "" "The *size* argument is normally passed to the decorated test method as an " "extra argument. If *dry_run* is ``True``, the value passed to the test " @@ -804,13 +823,11 @@ msgid "" "means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" -#: ../../library/test.rst:767 -msgid "" -"Decorator for tests that fill the address space. *f* is the function to " -"wrap." +#: ../../library/test.rst:775 +msgid "Decorator for tests that fill the address space." msgstr "" -#: ../../library/test.rst:773 +#: ../../library/test.rst:780 msgid "" "Test for syntax errors in *statement* by attempting to compile *statement*. " "*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " @@ -820,44 +837,44 @@ msgid "" "of the exception." msgstr "" -#: ../../library/test.rst:783 +#: ../../library/test.rst:790 msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" -#: ../../library/test.rst:788 +#: ../../library/test.rst:795 msgid "" "Use this at the end of ``test_main`` whenever sub-processes are started. " "This will help ensure that no extra children (zombies) stick around to hog " "resources and create problems when looking for refleaks." msgstr "" -#: ../../library/test.rst:795 +#: ../../library/test.rst:802 msgid "" "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " "is raised." msgstr "" -#: ../../library/test.rst:801 +#: ../../library/test.rst:808 msgid "" "Context manager catching unraisable exception using :func:`sys." "unraisablehook`." msgstr "" -#: ../../library/test.rst:804 +#: ../../library/test.rst:811 msgid "" "Storing the exception value (``cm.unraisable.exc_value``) creates a " "reference cycle. The reference cycle is broken explicitly when the context " "manager exits." msgstr "" -#: ../../library/test.rst:808 +#: ../../library/test.rst:815 msgid "" "Storing the object (``cm.unraisable.object``) can resurrect it if it is set " "to an object which is being finalized. Exiting the context manager clears " "the stored object." msgstr "" -#: ../../library/test.rst:829 +#: ../../library/test.rst:836 msgid "" "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " "use in test packages. *pkg_dir* is the root directory of the package; " @@ -866,55 +883,55 @@ msgid "" "the following::" msgstr "" -#: ../../library/test.rst:844 +#: ../../library/test.rst:851 msgid "" "Returns the set of attributes, functions or methods of *ref_api* not found " "on *other_api*, except for a defined list of items to be ignored in this " "check specified in *ignore*." msgstr "" -#: ../../library/test.rst:848 +#: ../../library/test.rst:855 msgid "" "By default this skips private attributes beginning with '_' but includes all " "magic methods, i.e. those starting and ending in '__'." msgstr "" -#: ../../library/test.rst:856 +#: ../../library/test.rst:863 msgid "" "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " "procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " "The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" -#: ../../library/test.rst:864 +#: ../../library/test.rst:871 msgid "" "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:" "`tracemalloc` is enabled." msgstr "" -#: ../../library/test.rst:870 -msgid "Assert that *iter* is deallocated after iterating." +#: ../../library/test.rst:877 +msgid "Assert instances of *cls* are deallocated after iterating." msgstr "" -#: ../../library/test.rst:875 +#: ../../library/test.rst:882 msgid "" "Check for the existence of the compiler executables whose names are listed " "in *cmd_names* or all the compiler executables when *cmd_names* is empty and " "return the first missing executable or ``None`` when none is found missing." msgstr "" -#: ../../library/test.rst:883 +#: ../../library/test.rst:890 msgid "" "Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" -#: ../../library/test.rst:885 +#: ../../library/test.rst:892 msgid "" "The module's public names (its API) are detected automatically based on " "whether they match the public name convention and were defined in *module*." msgstr "" -#: ../../library/test.rst:889 +#: ../../library/test.rst:896 msgid "" "The *name_of_module* argument can specify (as a string or tuple thereof) " "what module(s) an API could be defined in order to be detected as a public " @@ -922,7 +939,7 @@ msgid "" "other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" -#: ../../library/test.rst:894 +#: ../../library/test.rst:901 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " "automatically detected as \"public\", like objects without a proper " @@ -930,89 +947,100 @@ msgid "" "detected ones." msgstr "" -#: ../../library/test.rst:898 +#: ../../library/test.rst:905 msgid "" "The *not_exported* argument can be a set of names that must not be treated " "as part of the public API even though their names indicate otherwise." msgstr "" -#: ../../library/test.rst:901 ../../library/test.rst:1505 +#: ../../library/test.rst:908 ../../library/test.rst:1531 msgid "Example use::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/test.rst:924 +#: ../../library/test.rst:931 msgid "" "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " "there is no available semaphore implementation, or if creating a lock raises " "an :exc:`OSError`." msgstr "" -#: ../../library/test.rst:933 +#: ../../library/test.rst:940 msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" -#: ../../library/test.rst:938 +#: ../../library/test.rst:945 msgid "The :mod:`test.support` module defines the following classes:" msgstr "" -#: ../../library/test.rst:943 +#: ../../library/test.rst:950 msgid "" "A context manager used to try to prevent crash dialog popups on tests that " "are expected to crash a subprocess." msgstr "" -#: ../../library/test.rst:946 +#: ../../library/test.rst:953 msgid "" "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " "`_." msgstr "" -#: ../../library/test.rst:949 +#: ../../library/test.rst:956 msgid "" "On UNIX, :func:`resource.setrlimit` is used to set :attr:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" -#: ../../library/test.rst:953 +#: ../../library/test.rst:960 msgid "On both platforms, the old value is restored by :meth:`__exit__`." msgstr "" -#: ../../library/test.rst:958 +#: ../../library/test.rst:965 msgid "" "Class to save and restore signal handlers registered by the Python signal " "handler." msgstr "" -#: ../../library/test.rst:966 +#: ../../library/test.rst:970 +msgid "" +"Save the signal handlers to a dictionary mapping signal numbers to the " +"current signal handler." +msgstr "" + +#: ../../library/test.rst:975 +msgid "" +"Set the signal numbers from the :meth:`save` dictionary to the saved handler." +msgstr "" + +#: ../../library/test.rst:983 msgid "Try to match a single dict with the supplied arguments." msgstr "" -#: ../../library/test.rst:971 +#: ../../library/test.rst:988 msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" -#: ../../library/test.rst:978 +#: ../../library/test.rst:995 msgid "Run *test* and return the result." msgstr "" -#: ../../library/test.rst:982 +#: ../../library/test.rst:999 msgid ":mod:`test.support.socket_helper` --- Utilities for socket tests" msgstr "" -#: ../../library/test.rst:988 +#: ../../library/test.rst:1005 msgid "" "The :mod:`test.support.socket_helper` module provides support for socket " "tests." msgstr "" -#: ../../library/test.rst:995 +#: ../../library/test.rst:1012 msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1000 +#: ../../library/test.rst:1017 msgid "" "Returns an unused port that should be suitable for binding. This is " "achieved by creating a temporary socket with the same family and type as the " @@ -1023,7 +1051,7 @@ msgid "" "port is returned." msgstr "" -#: ../../library/test.rst:1009 +#: ../../library/test.rst:1026 msgid "" "Either this method or :func:`bind_port` should be used for any tests where a " "server socket needs to be bound to a particular port for the duration of the " @@ -1036,7 +1064,7 @@ msgid "" "simultaneously, which is a problem for buildbots." msgstr "" -#: ../../library/test.rst:1023 +#: ../../library/test.rst:1040 msgid "" "Bind the socket to a free port and return the port number. Relies on " "ephemeral ports in order to ensure we are using an unbound port. This is " @@ -1049,7 +1077,7 @@ msgid "" "testing multicasting via multiple UDP sockets." msgstr "" -#: ../../library/test.rst:1034 +#: ../../library/test.rst:1051 msgid "" "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " "available (i.e. on Windows), it will be set on the socket. This will " @@ -1057,58 +1085,58 @@ msgid "" "test." msgstr "" -#: ../../library/test.rst:1042 +#: ../../library/test.rst:1059 msgid "" "Bind a unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" -#: ../../library/test.rst:1048 +#: ../../library/test.rst:1065 msgid "" "A decorator for running tests that require a functional ``bind()`` for Unix " "sockets." msgstr "" -#: ../../library/test.rst:1054 +#: ../../library/test.rst:1071 msgid "" "A context manager that raises :exc:`~test.support.ResourceDenied` when " "various issues with the internet connection manifest themselves as " "exceptions." msgstr "" -#: ../../library/test.rst:1060 +#: ../../library/test.rst:1077 msgid "" ":mod:`test.support.script_helper` --- Utilities for the Python execution " "tests" msgstr "" -#: ../../library/test.rst:1066 +#: ../../library/test.rst:1083 msgid "" "The :mod:`test.support.script_helper` module provides support for Python's " "script execution tests." msgstr "" -#: ../../library/test.rst:1071 +#: ../../library/test.rst:1088 msgid "" "Return ``True`` if ``sys.executable interpreter`` requires environment " "variables in order to be able to run at all." msgstr "" -#: ../../library/test.rst:1074 +#: ../../library/test.rst:1091 msgid "" "This is designed to be used with ``@unittest.skipIf()`` to annotate tests " "that need to use an ``assert_python*()`` function to launch an isolated mode " "(``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" -#: ../../library/test.rst:1078 +#: ../../library/test.rst:1095 msgid "" "A normal build & test does not run into this situation but it can happen " "when trying to run the standard library test suite from an interpreter that " "doesn't have an obvious home with Python's current home finding logic." msgstr "" -#: ../../library/test.rst:1082 +#: ../../library/test.rst:1099 msgid "" "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " "in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " @@ -1116,85 +1144,85 @@ msgid "" "interpreter can start." msgstr "" -#: ../../library/test.rst:1090 +#: ../../library/test.rst:1107 msgid "" "Set up the environment based on *env_vars* for running the interpreter in a " "subprocess. The values can include ``__isolated``, ``__cleanenv``, " "``__cwd``, and ``TERM``." msgstr "" -#: ../../library/test.rst:1094 ../../library/test.rst:1110 -#: ../../library/test.rst:1122 +#: ../../library/test.rst:1111 ../../library/test.rst:1127 +#: ../../library/test.rst:1139 msgid "The function no longer strips whitespaces from *stderr*." msgstr "" -#: ../../library/test.rst:1100 +#: ../../library/test.rst:1117 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1104 +#: ../../library/test.rst:1121 msgid "" -"If the ``__cleanenv`` keyword is set, *env_vars* is used as a fresh " -"environment." +"If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " +"fresh environment." msgstr "" -#: ../../library/test.rst:1107 +#: ../../library/test.rst:1124 msgid "" "Python is started in isolated mode (command line option ``-I``), except if " -"the ``__isolated`` keyword is set to ``False``." +"the *__isolated* keyword-only parameter is set to ``False``." msgstr "" -#: ../../library/test.rst:1116 +#: ../../library/test.rst:1133 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* fails (``rc != 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1120 +#: ../../library/test.rst:1137 msgid "See :func:`assert_python_ok` for more options." msgstr "更多選項請見 :func:`assert_python_ok`\\ 。" -#: ../../library/test.rst:1128 +#: ../../library/test.rst:1145 msgid "Run a Python subprocess with the given arguments." msgstr "" -#: ../../library/test.rst:1130 +#: ../../library/test.rst:1147 msgid "" "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :" "class:`subprocess.Popen` object." msgstr "" -#: ../../library/test.rst:1136 +#: ../../library/test.rst:1153 msgid "" "Run the given :class:`subprocess.Popen` process until completion and return " "stdout." msgstr "" -#: ../../library/test.rst:1142 +#: ../../library/test.rst:1159 msgid "" "Create script containing *source* in path *script_dir* and " "*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " "name. Return the full script path." msgstr "" -#: ../../library/test.rst:1149 +#: ../../library/test.rst:1166 msgid "" "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which " "contains the files in *script_name*. *name_in_zip* is the archive name. " "Return a tuple containing ``(full path, full path of archive name)``." msgstr "" -#: ../../library/test.rst:1156 +#: ../../library/test.rst:1173 msgid "" "Create a directory named *pkg_dir* containing an ``__init__`` file with " "*init_source* as its contents." msgstr "" -#: ../../library/test.rst:1163 +#: ../../library/test.rst:1180 msgid "" "Create a zip package directory with a path of *zip_dir* and *zip_basename* " "containing an empty ``__init__`` file and a file *script_basename* " @@ -1203,160 +1231,166 @@ msgid "" "path and the archive name for the zip file." msgstr "" -#: ../../library/test.rst:1171 +#: ../../library/test.rst:1188 msgid "" ":mod:`test.support.bytecode_helper` --- Support tools for testing correct " "bytecode generation" msgstr "" -#: ../../library/test.rst:1176 +#: ../../library/test.rst:1193 msgid "" "The :mod:`test.support.bytecode_helper` module provides support for testing " "and inspecting bytecode generation." msgstr "" -#: ../../library/test.rst:1181 +#: ../../library/test.rst:1198 msgid "The module defines the following class:" msgstr "" -#: ../../library/test.rst:1185 +#: ../../library/test.rst:1202 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: ../../library/test.rst:1189 +#: ../../library/test.rst:1206 msgid "Return the disassembly of *co* as string." msgstr "" -#: ../../library/test.rst:1194 +#: ../../library/test.rst:1211 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: ../../library/test.rst:1199 +#: ../../library/test.rst:1216 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" -#: ../../library/test.rst:1203 +#: ../../library/test.rst:1220 msgid ":mod:`test.support.threading_helper` --- Utilities for threading tests" msgstr "" -#: ../../library/test.rst:1208 +#: ../../library/test.rst:1225 msgid "" "The :mod:`test.support.threading_helper` module provides support for " "threading tests." msgstr "" -#: ../../library/test.rst:1215 +#: ../../library/test.rst:1232 msgid "" "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " "is still alive after *timeout* seconds." msgstr "" -#: ../../library/test.rst:1221 +#: ../../library/test.rst:1238 msgid "Decorator to ensure the threads are cleaned up even if the test fails." msgstr "" -#: ../../library/test.rst:1226 +#: ../../library/test.rst:1243 msgid "" -"Context manager to start *threads*. It attempts to join the threads upon " -"exit." +"Context manager to start *threads*, which is a sequence of threads. *unlock* " +"is a function called after the threads are started, even if an exception was " +"raised; an example would be :meth:`threading.Event.set`. ``start_threads`` " +"will attempt to join the started threads upon exit." msgstr "" -#: ../../library/test.rst:1232 +#: ../../library/test.rst:1251 msgid "" "Cleanup up threads not specified in *original_values*. Designed to emit a " "warning if a test leaves running threads in the background." msgstr "" -#: ../../library/test.rst:1238 +#: ../../library/test.rst:1257 msgid "Return current thread count and copy of dangling threads." msgstr "" -#: ../../library/test.rst:1243 +#: ../../library/test.rst:1262 msgid "" "Context manager to wait until all threads created in the ``with`` statement " "exit." msgstr "" -#: ../../library/test.rst:1249 +#: ../../library/test.rst:1268 msgid "" "Context manager catching :class:`threading.Thread` exception using :func:" "`threading.excepthook`." msgstr "" -#: ../../library/test.rst:1252 +#: ../../library/test.rst:1271 msgid "Attributes set when an exception is caught:" msgstr "" -#: ../../library/test.rst:1254 +#: ../../library/test.rst:1273 msgid "``exc_type``" msgstr "``exc_type``" -#: ../../library/test.rst:1255 +#: ../../library/test.rst:1274 msgid "``exc_value``" msgstr "``exc_value``" -#: ../../library/test.rst:1256 +#: ../../library/test.rst:1275 msgid "``exc_traceback``" msgstr "``exc_traceback``" -#: ../../library/test.rst:1257 +#: ../../library/test.rst:1276 msgid "``thread``" msgstr "``thread``" -#: ../../library/test.rst:1259 +#: ../../library/test.rst:1278 msgid "See :func:`threading.excepthook` documentation." msgstr "參閱 :func:`threading.excepthook` 文件。" -#: ../../library/test.rst:1261 +#: ../../library/test.rst:1280 msgid "These attributes are deleted at the context manager exit." msgstr "" -#: ../../library/test.rst:1281 +#: ../../library/test.rst:1300 msgid ":mod:`test.support.os_helper` --- Utilities for os tests" msgstr "" -#: ../../library/test.rst:1286 +#: ../../library/test.rst:1305 msgid "The :mod:`test.support.os_helper` module provides support for os tests." msgstr "" -#: ../../library/test.rst:1293 +#: ../../library/test.rst:1312 msgid "A non-ASCII character encodable by :func:`os.fsencode`." msgstr "" -#: ../../library/test.rst:1298 +#: ../../library/test.rst:1317 msgid "Set to :func:`os.getcwd`." msgstr "" -#: ../../library/test.rst:1303 +#: ../../library/test.rst:1322 msgid "" "Set to a name that is safe to use as the name of a temporary file. Any " "temporary file that is created should be closed and unlinked (removed)." msgstr "" -#: ../../library/test.rst:1309 -msgid "Set to a filename containing the :data:`FS_NONASCII` character." +#: ../../library/test.rst:1328 +msgid "" +"Set to a filename containing the :data:`FS_NONASCII` character, if it " +"exists. This guarantees that if the filename exists, it can be encoded and " +"decoded with the default filesystem encoding. This allows tests that require " +"a non-ASCII filename to be easily skipped on platforms where they can't work." msgstr "" -#: ../../library/test.rst:1314 +#: ../../library/test.rst:1336 msgid "" "Set to a filename (str type) that should not be able to be encoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1321 +#: ../../library/test.rst:1343 msgid "" "Set to a filename (bytes type) that should not be able to be decoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1328 +#: ../../library/test.rst:1350 msgid "Set to a non-ASCII name for a temporary file." msgstr "" -#: ../../library/test.rst:1333 +#: ../../library/test.rst:1355 msgid "" "Class used to temporarily set or unset environment variables. Instances can " "be used as a context manager and have a complete dictionary interface for " @@ -1365,95 +1399,97 @@ msgid "" "instance will be rolled back." msgstr "" -#: ../../library/test.rst:1339 +#: ../../library/test.rst:1361 msgid "Added dictionary interface." msgstr "" -#: ../../library/test.rst:1345 +#: ../../library/test.rst:1367 msgid "" "Simple :term:`path-like object`. It implements the :meth:`__fspath__` " "method which just returns the *path* argument. If *path* is an exception, " "it will be raised in :meth:`!__fspath__`." msgstr "" -#: ../../library/test.rst:1352 +#: ../../library/test.rst:1374 msgid "" "Temporarily set the environment variable ``envvar`` to the value of " "``value``." msgstr "" -#: ../../library/test.rst:1358 +#: ../../library/test.rst:1380 msgid "Temporarily unset the environment variable ``envvar``." msgstr "" -#: ../../library/test.rst:1363 +#: ../../library/test.rst:1385 msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1369 +#: ../../library/test.rst:1391 msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1375 +#: ../../library/test.rst:1397 msgid "" "A context manager that temporarily changes the current working directory to " "*path* and yields the directory." msgstr "" -#: ../../library/test.rst:1378 +#: ../../library/test.rst:1400 msgid "" "If *quiet* is ``False``, the context manager raises an exception on error. " "Otherwise, it issues only a warning and keeps the current working directory " "the same." msgstr "" -#: ../../library/test.rst:1385 +#: ../../library/test.rst:1407 msgid "" "Create an empty file with *filename*. If it already exists, truncate it." msgstr "" -#: ../../library/test.rst:1390 +#: ../../library/test.rst:1412 msgid "Count the number of open file descriptors." msgstr "" -#: ../../library/test.rst:1395 +#: ../../library/test.rst:1417 msgid "Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" -#: ../../library/test.rst:1400 +#: ../../library/test.rst:1422 msgid "" "Create an invalid file descriptor by opening and closing a temporary file, " "and returning its descriptor." msgstr "" -#: ../../library/test.rst:1406 +#: ../../library/test.rst:1428 msgid "" "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " -"with a wait loop that checks for the existence of the file." +"with a wait loop that checks for the existence of the file, which is needed " +"due to antivirus programs that can hold files open and prevent deletion." msgstr "" -#: ../../library/test.rst:1412 +#: ../../library/test.rst:1436 msgid "" "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os." -"rmdir` to remove a path and its contents. On Windows platforms, this is " -"wrapped with a wait loop that checks for the existence of the files." +"rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows " +"platforms this is wrapped with a wait loop that checks for the existence of " +"the files." msgstr "" -#: ../../library/test.rst:1419 +#: ../../library/test.rst:1444 msgid "A decorator for running tests that require support for symbolic links." msgstr "" -#: ../../library/test.rst:1424 +#: ../../library/test.rst:1449 msgid "A decorator for running tests that require support for xattr." msgstr "" -#: ../../library/test.rst:1429 +#: ../../library/test.rst:1454 msgid "" "A context manager that temporarily creates a new directory and changes the " "current working directory (CWD)." msgstr "" -#: ../../library/test.rst:1432 +#: ../../library/test.rst:1457 msgid "" "The context manager creates a temporary directory in the current directory " "with name *name* before temporarily changing the current working directory. " @@ -1461,20 +1497,20 @@ msgid "" "`tempfile.mkdtemp`." msgstr "" -#: ../../library/test.rst:1437 +#: ../../library/test.rst:1462 msgid "" "If *quiet* is ``False`` and it is not possible to create or change the CWD, " "an error is raised. Otherwise, only a warning is raised and the original " "CWD is used." msgstr "" -#: ../../library/test.rst:1444 +#: ../../library/test.rst:1469 msgid "" "A context manager that creates a temporary directory at *path* and yields " "the directory." msgstr "" -#: ../../library/test.rst:1447 +#: ../../library/test.rst:1472 msgid "" "If *path* is ``None``, the temporary directory is created using :func:" "`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an " @@ -1482,33 +1518,34 @@ msgid "" "created, only a warning is issued." msgstr "" -#: ../../library/test.rst:1455 +#: ../../library/test.rst:1480 msgid "A context manager that temporarily sets the process umask." msgstr "" -#: ../../library/test.rst:1460 +#: ../../library/test.rst:1485 msgid "" -"Call :func:`os.unlink` on *filename*. On Windows platforms, this is wrapped " -"with a wait loop that checks for the existence of the file." +"Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " +"platforms, this is wrapped with a wait loop that checks for the existence of " +"the file." msgstr "" -#: ../../library/test.rst:1465 +#: ../../library/test.rst:1491 msgid ":mod:`test.support.import_helper` --- Utilities for import tests" msgstr "" -#: ../../library/test.rst:1470 +#: ../../library/test.rst:1496 msgid "" "The :mod:`test.support.import_helper` module provides support for import " "tests." msgstr "" -#: ../../library/test.rst:1477 +#: ../../library/test.rst:1503 msgid "" "Remove the module named *module_name* from ``sys.modules`` and delete any " "byte-compiled files of the module." msgstr "" -#: ../../library/test.rst:1483 +#: ../../library/test.rst:1509 msgid "" "This function imports and returns a fresh copy of the named Python module by " "removing the named module from ``sys.modules`` before doing the import. Note " @@ -1516,46 +1553,46 @@ msgid "" "operation." msgstr "" -#: ../../library/test.rst:1488 +#: ../../library/test.rst:1514 msgid "" "*fresh* is an iterable of additional module names that are also removed from " "the ``sys.modules`` cache before doing the import." msgstr "" -#: ../../library/test.rst:1491 +#: ../../library/test.rst:1517 msgid "" "*blocked* is an iterable of module names that are replaced with ``None`` in " "the module cache during the import to ensure that attempts to import them " "raise :exc:`ImportError`." msgstr "" -#: ../../library/test.rst:1495 +#: ../../library/test.rst:1521 msgid "" "The named module and any modules named in the *fresh* and *blocked* " "parameters are saved before starting the import and then reinserted into " "``sys.modules`` when the fresh import is complete." msgstr "" -#: ../../library/test.rst:1499 +#: ../../library/test.rst:1525 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``." msgstr "" -#: ../../library/test.rst:1502 +#: ../../library/test.rst:1528 msgid "" "This function will raise :exc:`ImportError` if the named module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1519 +#: ../../library/test.rst:1545 msgid "" "This function imports and returns the named module. Unlike a normal import, " "this function raises :exc:`unittest.SkipTest` if the module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1523 +#: ../../library/test.rst:1549 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``. If a module is required on a platform but " @@ -1563,21 +1600,21 @@ msgid "" "which will be compared against :data:`sys.platform`." msgstr "" -#: ../../library/test.rst:1533 +#: ../../library/test.rst:1559 msgid "Return a copy of :data:`sys.modules`." msgstr "" -#: ../../library/test.rst:1538 +#: ../../library/test.rst:1564 msgid "" "Remove modules except for *oldmodules* and ``encodings`` in order to " "preserve internal cache." msgstr "" -#: ../../library/test.rst:1544 +#: ../../library/test.rst:1570 msgid "Delete *name* from ``sys.modules``." msgstr "" -#: ../../library/test.rst:1549 +#: ../../library/test.rst:1575 msgid "" "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return " "the file system path to the legacy pyc file. The *source* value is the file " @@ -1585,49 +1622,49 @@ msgid "" "3147/488 pyc file must exist." msgstr "" -#: ../../library/test.rst:1557 +#: ../../library/test.rst:1583 msgid "" "A context manager to force import to return a new module reference. This is " -"useful for testing module-level behaviors, such as the emission of a " -"DeprecationWarning on import. Example usage::" +"useful for testing module-level behaviors, such as the emission of a :exc:" +"`DeprecationWarning` on import. Example usage::" msgstr "" -#: ../../library/test.rst:1567 -msgid "A context manager to temporarily add directories to sys.path." +#: ../../library/test.rst:1593 +msgid "A context manager to temporarily add directories to :data:`sys.path`." msgstr "" -#: ../../library/test.rst:1569 +#: ../../library/test.rst:1595 msgid "" "This makes a copy of :data:`sys.path`, appends any directories given as " "positional arguments, then reverts :data:`sys.path` to the copied settings " "when the context ends." msgstr "" -#: ../../library/test.rst:1573 +#: ../../library/test.rst:1599 msgid "" "Note that *all* :data:`sys.path` modifications in the body of the context " "manager, including replacement of the object, will be reverted at the end of " "the block." msgstr "" -#: ../../library/test.rst:1579 +#: ../../library/test.rst:1605 msgid ":mod:`test.support.warnings_helper` --- Utilities for warnings tests" msgstr "" -#: ../../library/test.rst:1584 +#: ../../library/test.rst:1610 msgid "" "The :mod:`test.support.warnings_helper` module provides support for warnings " "tests." msgstr "" -#: ../../library/test.rst:1591 +#: ../../library/test.rst:1617 msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: ../../library/test.rst:1598 +#: ../../library/test.rst:1624 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1639,7 +1676,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1612 +#: ../../library/test.rst:1638 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1648,7 +1685,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1618 +#: ../../library/test.rst:1644 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1660,15 +1697,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1627 +#: ../../library/test.rst:1653 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: ../../library/test.rst:1631 +#: ../../library/test.rst:1657 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1633 +#: ../../library/test.rst:1659 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1680,39 +1717,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1642 +#: ../../library/test.rst:1668 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1645 +#: ../../library/test.rst:1671 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1652 +#: ../../library/test.rst:1678 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: ../../library/test.rst:1655 +#: ../../library/test.rst:1681 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: ../../library/test.rst:1669 +#: ../../library/test.rst:1695 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1672 +#: ../../library/test.rst:1698 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: ../../library/test.rst:1678 +#: ../../library/test.rst:1704 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index bec4dca2f1..63ad781b52 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.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-05-30 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,7 +34,7 @@ msgstr "A.M. Kuchling" msgid "" "This article explains the new features in Python 2.5. The final release of " "Python 2.5 is scheduled for August 2006; :pep:`356` describes the planned " -"release schedule." +"release schedule. Python 2.5 was released on September 19, 2006." msgstr "" #: ../../whatsnew/2.5.rst:16 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 896722da7c..df62ffac0d 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.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-05-30 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,7 @@ msgstr "A.M. Kuchling (amk at amk.ca)" #: ../../whatsnew/2.6.rst:52 msgid "" -"This article explains the new features in Python 2.6, released on October 1 " +"This article explains the new features in Python 2.6, released on October 1, " "2008. The release schedule is described in :pep:`361`." msgstr "" diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index f31621ea97..7fe0cbba56 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.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-05-30 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,11 +34,12 @@ msgstr "Guido van Rossum" msgid "" "This article explains the new features in Python 3.0, compared to 2.6. " "Python 3.0, also known as \"Python 3000\" or \"Py3K\", is the first ever " -"*intentionally backwards incompatible* Python release. There are more " -"changes than in a typical release, and more that are important for all " -"Python users. Nevertheless, after digesting the changes, you'll find that " -"Python really hasn't changed all that much -- by and large, we're mostly " -"fixing well-known annoyances and warts, and removing a lot of old cruft." +"*intentionally backwards incompatible* Python release. Python 3.0 was " +"released on December 3, 2008. There are more changes than in a typical " +"release, and more that are important for all Python users. Nevertheless, " +"after digesting the changes, you'll find that Python really hasn't changed " +"all that much -- by and large, we're mostly fixing well-known annoyances and " +"warts, and removing a lot of old cruft." msgstr "" #: ../../whatsnew/3.0.rst:63 @@ -846,7 +847,8 @@ msgstr "" #: ../../whatsnew/3.0.rst:609 msgid ":mod:`html` (:mod:`HTMLParser`, :mod:`htmlentitydefs`)." -msgstr ":mod:`html`\\ (\\ :mod:`HTMLParser`\\ 、\\ :mod:`htmlentitydefs`\\ )。" +msgstr "" +":mod:`html`\\ (\\ :mod:`HTMLParser`\\ 、\\ :mod:`htmlentitydefs`\\ )。" #: ../../whatsnew/3.0.rst:611 msgid "" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 36941e1d37..d804c098f5 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-29 00:11+0000\n" +"POT-Creation-Date: 2022-05-30 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,14 +31,16 @@ msgid "Raymond Hettinger" msgstr "Raymond Hettinger" #: ../../whatsnew/3.1.rst:49 -msgid "This article explains the new features in Python 3.1, compared to 3.0." +msgid "" +"This article explains the new features in Python 3.1, compared to 3.0. " +"Python 3.1 was released on June 27, 2009." msgstr "" -#: ../../whatsnew/3.1.rst:53 +#: ../../whatsnew/3.1.rst:54 msgid "PEP 372: Ordered Dictionaries" msgstr "" -#: ../../whatsnew/3.1.rst:55 +#: ../../whatsnew/3.1.rst:56 msgid "" "Regular Python dictionaries iterate over key/value pairs in arbitrary order. " "Over the years, a number of authors have written alternative implementations " @@ -47,7 +49,7 @@ msgid "" "OrderedDict` class has been introduced." msgstr "" -#: ../../whatsnew/3.1.rst:61 +#: ../../whatsnew/3.1.rst:62 msgid "" "The OrderedDict API is substantially the same as regular dictionaries but " "will iterate over keys and values in a guaranteed order depending on when a " @@ -56,7 +58,7 @@ msgid "" "reinserting it will move it to the end." msgstr "" -#: ../../whatsnew/3.1.rst:67 +#: ../../whatsnew/3.1.rst:68 msgid "" "The standard library now supports use of ordered dictionaries in several " "modules. The :mod:`configparser` module uses them by default. This lets " @@ -69,21 +71,21 @@ msgid "" "`_." msgstr "" -#: ../../whatsnew/3.1.rst:79 +#: ../../whatsnew/3.1.rst:80 msgid ":pep:`372` - Ordered Dictionaries" msgstr "" -#: ../../whatsnew/3.1.rst:79 +#: ../../whatsnew/3.1.rst:80 msgid "" "PEP written by Armin Ronacher and Raymond Hettinger. Implementation written " "by Raymond Hettinger." msgstr "" -#: ../../whatsnew/3.1.rst:84 +#: ../../whatsnew/3.1.rst:85 msgid "PEP 378: Format Specifier for Thousands Separator" msgstr "" -#: ../../whatsnew/3.1.rst:86 +#: ../../whatsnew/3.1.rst:87 msgid "" "The built-in :func:`format` function and the :meth:`str.format` method use a " "mini-language that now includes a simple, non-locale aware way to format a " @@ -91,13 +93,13 @@ msgid "" "program's output, improving its professional appearance and readability::" msgstr "" -#: ../../whatsnew/3.1.rst:100 +#: ../../whatsnew/3.1.rst:101 msgid "" "The supported types are :class:`int`, :class:`float`, :class:`complex` and :" "class:`decimal.Decimal`." msgstr "" -#: ../../whatsnew/3.1.rst:103 +#: ../../whatsnew/3.1.rst:104 msgid "" "Discussions are underway about how to specify alternative separators like " "dots, spaces, apostrophes, or underscores. Locale-aware applications should " @@ -105,25 +107,25 @@ msgid "" "thousands separators." msgstr "" -#: ../../whatsnew/3.1.rst:111 +#: ../../whatsnew/3.1.rst:112 msgid ":pep:`378` - Format Specifier for Thousands Separator" msgstr "" -#: ../../whatsnew/3.1.rst:111 +#: ../../whatsnew/3.1.rst:112 msgid "" "PEP written by Raymond Hettinger and implemented by Eric Smith and Mark " "Dickinson." msgstr "" -#: ../../whatsnew/3.1.rst:116 +#: ../../whatsnew/3.1.rst:117 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.1.rst:118 +#: ../../whatsnew/3.1.rst:119 msgid "Some smaller changes made to the core Python language are:" msgstr "" -#: ../../whatsnew/3.1.rst:120 +#: ../../whatsnew/3.1.rst:121 msgid "" "Directories and zip archives containing a :file:`__main__.py` file can now " "be executed directly by passing their name to the interpreter. The directory/" @@ -132,34 +134,34 @@ msgid "" "and Nick Coghlan; :issue:`1739468`.)" msgstr "" -#: ../../whatsnew/3.1.rst:126 +#: ../../whatsnew/3.1.rst:127 msgid "" "The :func:`int` type gained a ``bit_length`` method that returns the number " "of bits necessary to represent its argument in binary::" msgstr "" -#: ../../whatsnew/3.1.rst:140 +#: ../../whatsnew/3.1.rst:141 msgid "" "(Contributed by Fredrik Johansson, Victor Stinner, Raymond Hettinger, and " "Mark Dickinson; :issue:`3439`.)" msgstr "" -#: ../../whatsnew/3.1.rst:143 +#: ../../whatsnew/3.1.rst:144 msgid "" "The fields in :func:`format` strings can now be automatically numbered::" msgstr "" -#: ../../whatsnew/3.1.rst:149 +#: ../../whatsnew/3.1.rst:150 msgid "" "Formerly, the string would have required numbered fields such as: ``'Sir {0} " "of {1}'``." msgstr "" -#: ../../whatsnew/3.1.rst:152 +#: ../../whatsnew/3.1.rst:153 msgid "(Contributed by Eric Smith; :issue:`5237`.)" msgstr "" -#: ../../whatsnew/3.1.rst:154 +#: ../../whatsnew/3.1.rst:155 msgid "" "The :func:`string.maketrans` function is deprecated and is replaced by new " "static methods, :meth:`bytes.maketrans` and :meth:`bytearray.maketrans`. " @@ -169,46 +171,46 @@ msgid "" "intermediate translation tables of the appropriate type." msgstr "" -#: ../../whatsnew/3.1.rst:161 +#: ../../whatsnew/3.1.rst:162 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" msgstr "" -#: ../../whatsnew/3.1.rst:163 +#: ../../whatsnew/3.1.rst:164 msgid "" "The syntax of the :keyword:`with` statement now allows multiple context " "managers in a single statement::" msgstr "" -#: ../../whatsnew/3.1.rst:171 +#: ../../whatsnew/3.1.rst:172 msgid "" "With the new syntax, the :func:`contextlib.nested` function is no longer " "needed and is now deprecated." msgstr "" -#: ../../whatsnew/3.1.rst:174 +#: ../../whatsnew/3.1.rst:175 msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" -#: ../../whatsnew/3.1.rst:177 +#: ../../whatsnew/3.1.rst:178 msgid "" "``round(x, n)`` now returns an integer if *x* is an integer. Previously it " "returned a float::" msgstr "" -#: ../../whatsnew/3.1.rst:183 +#: ../../whatsnew/3.1.rst:184 msgid "(Contributed by Mark Dickinson; :issue:`4707`.)" msgstr "" -#: ../../whatsnew/3.1.rst:185 +#: ../../whatsnew/3.1.rst:186 msgid "" "Python now uses David Gay's algorithm for finding the shortest floating " "point representation that doesn't change its value. This should help " "mitigate some of the confusion surrounding binary floating point numbers." msgstr "" -#: ../../whatsnew/3.1.rst:190 +#: ../../whatsnew/3.1.rst:191 msgid "" "The significance is easily seen with a number like ``1.1`` which does not " "have an exact equivalent in binary floating point. Since there is no exact " @@ -219,7 +221,7 @@ msgid "" "calculations." msgstr "" -#: ../../whatsnew/3.1.rst:198 +#: ../../whatsnew/3.1.rst:199 msgid "" "What is new is how the number gets displayed. Formerly, Python used a " "simple approach. The value of ``repr(1.1)`` was computed as ``format(1.1, " @@ -231,7 +233,7 @@ msgid "" "problem with Python itself)." msgstr "" -#: ../../whatsnew/3.1.rst:207 +#: ../../whatsnew/3.1.rst:208 msgid "" "The new algorithm for ``repr(1.1)`` is smarter and returns ``'1.1'``. " "Effectively, it searches all equivalent string representations (ones that " @@ -239,14 +241,14 @@ msgid "" "representation." msgstr "" -#: ../../whatsnew/3.1.rst:212 +#: ../../whatsnew/3.1.rst:213 msgid "" "The new algorithm tends to emit cleaner representations when possible, but " "it does not change the underlying values. So, it is still the case that " "``1.1 + 2.2 != 3.3`` even though the representations may suggest otherwise." msgstr "" -#: ../../whatsnew/3.1.rst:216 +#: ../../whatsnew/3.1.rst:217 msgid "" "The new algorithm depends on certain features in the underlying floating " "point implementation. If the required features are not found, the old " @@ -254,64 +256,64 @@ msgid "" "cross-platform portability by using the old algorithm." msgstr "" -#: ../../whatsnew/3.1.rst:221 +#: ../../whatsnew/3.1.rst:222 msgid "(Contributed by Eric Smith and Mark Dickinson; :issue:`1580`)" msgstr "" -#: ../../whatsnew/3.1.rst:224 +#: ../../whatsnew/3.1.rst:225 msgid "New, Improved, and Deprecated Modules" msgstr "" -#: ../../whatsnew/3.1.rst:226 +#: ../../whatsnew/3.1.rst:227 msgid "" "Added a :class:`collections.Counter` class to support convenient counting of " "unique items in a sequence or iterable::" msgstr "" -#: ../../whatsnew/3.1.rst:232 +#: ../../whatsnew/3.1.rst:233 msgid "(Contributed by Raymond Hettinger; :issue:`1696199`.)" msgstr "" -#: ../../whatsnew/3.1.rst:234 +#: ../../whatsnew/3.1.rst:235 msgid "" "Added a new module, :mod:`tkinter.ttk` for access to the Tk themed widget " "set. The basic idea of ttk is to separate, to the extent possible, the code " "implementing a widget's behavior from the code implementing its appearance." msgstr "" -#: ../../whatsnew/3.1.rst:238 +#: ../../whatsnew/3.1.rst:239 msgid "(Contributed by Guilherme Polo; :issue:`2983`.)" msgstr "" -#: ../../whatsnew/3.1.rst:240 +#: ../../whatsnew/3.1.rst:241 msgid "" "The :class:`gzip.GzipFile` and :class:`bz2.BZ2File` classes now support the " "context management protocol::" msgstr "" -#: ../../whatsnew/3.1.rst:247 +#: ../../whatsnew/3.1.rst:248 msgid "(Contributed by Antoine Pitrou.)" msgstr "" -#: ../../whatsnew/3.1.rst:249 +#: ../../whatsnew/3.1.rst:250 msgid "" "The :mod:`decimal` module now supports methods for creating a decimal object " "from a binary :class:`float`. The conversion is exact but can sometimes be " "surprising::" msgstr "" -#: ../../whatsnew/3.1.rst:256 +#: ../../whatsnew/3.1.rst:257 msgid "" "The long decimal result shows the actual binary fraction being stored for " "*1.1*. The fraction has many digits because *1.1* cannot be exactly " "represented in binary." msgstr "" -#: ../../whatsnew/3.1.rst:260 +#: ../../whatsnew/3.1.rst:261 msgid "(Contributed by Raymond Hettinger and Mark Dickinson.)" msgstr "" -#: ../../whatsnew/3.1.rst:262 +#: ../../whatsnew/3.1.rst:263 msgid "" "The :mod:`itertools` module grew two new functions. The :func:`itertools." "combinations_with_replacement` function is one of four for generating " @@ -322,11 +324,11 @@ msgid "" "`fractions.Fraction` and :class:`decimal.Decimal`::" msgstr "" -#: ../../whatsnew/3.1.rst:281 +#: ../../whatsnew/3.1.rst:282 msgid "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/3.1.rst:283 +#: ../../whatsnew/3.1.rst:284 msgid "" ":func:`collections.namedtuple` now supports a keyword argument *rename* " "which lets invalid fieldnames be automatically converted to positional names " @@ -335,21 +337,21 @@ msgid "" "input::" msgstr "" -#: ../../whatsnew/3.1.rst:300 +#: ../../whatsnew/3.1.rst:301 msgid "(Contributed by Raymond Hettinger; :issue:`1818`.)" msgstr "" -#: ../../whatsnew/3.1.rst:302 +#: ../../whatsnew/3.1.rst:303 msgid "" "The :func:`re.sub`, :func:`re.subn` and :func:`re.split` functions now " "accept a flags parameter." msgstr "" -#: ../../whatsnew/3.1.rst:305 +#: ../../whatsnew/3.1.rst:306 msgid "(Contributed by Gregory Smith.)" msgstr "" -#: ../../whatsnew/3.1.rst:307 +#: ../../whatsnew/3.1.rst:308 msgid "" "The :mod:`logging` module now implements a simple :class:`logging." "NullHandler` class for applications that are not using logging but are " @@ -357,52 +359,52 @@ msgid "" "spurious warnings such as \"No handlers could be found for logger foo\"::" msgstr "" -#: ../../whatsnew/3.1.rst:315 +#: ../../whatsnew/3.1.rst:316 msgid "(Contributed by Vinay Sajip; :issue:`4384`)." msgstr "" -#: ../../whatsnew/3.1.rst:317 +#: ../../whatsnew/3.1.rst:318 msgid "" "The :mod:`runpy` module which supports the ``-m`` command line switch now " "supports the execution of packages by looking for and executing a " "``__main__`` submodule when a package name is supplied." msgstr "" -#: ../../whatsnew/3.1.rst:321 +#: ../../whatsnew/3.1.rst:322 msgid "(Contributed by Andi Vajda; :issue:`4195`.)" msgstr "" -#: ../../whatsnew/3.1.rst:323 +#: ../../whatsnew/3.1.rst:324 msgid "" "The :mod:`pdb` module can now access and display source code loaded via :mod:" "`zipimport` (or any other conformant :pep:`302` loader)." msgstr "" -#: ../../whatsnew/3.1.rst:326 +#: ../../whatsnew/3.1.rst:327 msgid "(Contributed by Alexander Belopolsky; :issue:`4201`.)" msgstr "" -#: ../../whatsnew/3.1.rst:328 +#: ../../whatsnew/3.1.rst:329 msgid ":class:`functools.partial` objects can now be pickled." msgstr "" -#: ../../whatsnew/3.1.rst:330 +#: ../../whatsnew/3.1.rst:331 msgid "" "(Suggested by Antoine Pitrou and Jesse Noller. Implemented by Jack " "Diederich; :issue:`5228`.)" msgstr "" -#: ../../whatsnew/3.1.rst:333 +#: ../../whatsnew/3.1.rst:334 msgid "" "Add :mod:`pydoc` help topics for symbols so that ``help('@')`` works as " "expected in the interactive environment." msgstr "" -#: ../../whatsnew/3.1.rst:336 +#: ../../whatsnew/3.1.rst:337 msgid "(Contributed by David Laban; :issue:`4739`.)" msgstr "" -#: ../../whatsnew/3.1.rst:338 +#: ../../whatsnew/3.1.rst:339 msgid "" "The :mod:`unittest` module now supports skipping individual tests or classes " "of tests. And it supports marking a test as an expected failure, a test that " @@ -410,13 +412,13 @@ msgid "" "TestResult::" msgstr "" -#: ../../whatsnew/3.1.rst:353 +#: ../../whatsnew/3.1.rst:354 msgid "" "Also, tests for exceptions have been builtout to work with context managers " "using the :keyword:`with` statement::" msgstr "" -#: ../../whatsnew/3.1.rst:360 +#: ../../whatsnew/3.1.rst:361 msgid "" "In addition, several new assertion methods were added including :func:" "`assertSetEqual`, :func:`assertDictEqual`, :func:" @@ -425,33 +427,33 @@ msgid "" "`assertRaisesRegexp`, :func:`assertIsNone`, and :func:`assertIsNotNone`." msgstr "" -#: ../../whatsnew/3.1.rst:367 +#: ../../whatsnew/3.1.rst:368 msgid "(Contributed by Benjamin Peterson and Antoine Pitrou.)" msgstr "" -#: ../../whatsnew/3.1.rst:369 +#: ../../whatsnew/3.1.rst:370 msgid "" "The :mod:`io` module has three new constants for the :meth:`seek` method :" "data:`SEEK_SET`, :data:`SEEK_CUR`, and :data:`SEEK_END`." msgstr "" -#: ../../whatsnew/3.1.rst:372 +#: ../../whatsnew/3.1.rst:373 msgid "The :attr:`sys.version_info` tuple is now a named tuple::" msgstr "" -#: ../../whatsnew/3.1.rst:377 +#: ../../whatsnew/3.1.rst:378 msgid "(Contributed by Ross Light; :issue:`4285`.)" msgstr "" -#: ../../whatsnew/3.1.rst:379 +#: ../../whatsnew/3.1.rst:380 msgid "The :mod:`nntplib` and :mod:`imaplib` modules now support IPv6." msgstr "" -#: ../../whatsnew/3.1.rst:381 +#: ../../whatsnew/3.1.rst:382 msgid "(Contributed by Derek Morr; :issue:`1655` and :issue:`1664`.)" msgstr "" -#: ../../whatsnew/3.1.rst:383 +#: ../../whatsnew/3.1.rst:384 msgid "" "The :mod:`pickle` module has been adapted for better interoperability with " "Python 2.x when used with protocol 2 or lower. The reorganization of the " @@ -464,7 +466,7 @@ msgid "" "*fix_imports* option::" msgstr "" -#: ../../whatsnew/3.1.rst:399 +#: ../../whatsnew/3.1.rst:400 msgid "" "An unfortunate but unavoidable side-effect of this change is that protocol 2 " "pickles produced by Python 3.1 won't be readable with Python 3.0. The latest " @@ -473,12 +475,12 @@ msgid "" "Python 2.x." msgstr "" -#: ../../whatsnew/3.1.rst:405 +#: ../../whatsnew/3.1.rst:406 msgid "" "(Contributed by Alexandre Vassalotti and Antoine Pitrou, :issue:`6137`.)" msgstr "" -#: ../../whatsnew/3.1.rst:407 +#: ../../whatsnew/3.1.rst:408 msgid "" "A new module, :mod:`importlib` was added. It provides a complete, portable, " "pure Python reference implementation of the :keyword:`import` statement and " @@ -487,19 +489,19 @@ msgid "" "place during imports." msgstr "" -#: ../../whatsnew/3.1.rst:413 +#: ../../whatsnew/3.1.rst:414 msgid "(Contributed by Brett Cannon.)" msgstr "" -#: ../../whatsnew/3.1.rst:416 +#: ../../whatsnew/3.1.rst:417 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.1.rst:418 +#: ../../whatsnew/3.1.rst:419 msgid "Major performance enhancements have been added:" msgstr "" -#: ../../whatsnew/3.1.rst:420 +#: ../../whatsnew/3.1.rst:421 msgid "" "The new I/O library (as defined in :pep:`3116`) was mostly written in Python " "and quickly proved to be a problematic bottleneck in Python 3.0. In Python " @@ -508,11 +510,11 @@ msgid "" "available for experimentation purposes through the ``_pyio`` module." msgstr "" -#: ../../whatsnew/3.1.rst:427 +#: ../../whatsnew/3.1.rst:428 msgid "(Contributed by Amaury Forgeot d'Arc and Antoine Pitrou.)" msgstr "" -#: ../../whatsnew/3.1.rst:429 +#: ../../whatsnew/3.1.rst:430 msgid "" "Added a heuristic so that tuples and dicts containing only untrackable " "objects are not tracked by the garbage collector. This can reduce the size " @@ -520,11 +522,11 @@ msgid "" "programs, depending on their particular use of datatypes." msgstr "" -#: ../../whatsnew/3.1.rst:434 +#: ../../whatsnew/3.1.rst:435 msgid "(Contributed by Antoine Pitrou, :issue:`4688`.)" msgstr "" -#: ../../whatsnew/3.1.rst:436 +#: ../../whatsnew/3.1.rst:437 msgid "" "Enabling a configure option named ``--with-computed-gotos`` on compilers " "that support it (notably: gcc, SunPro, icc), the bytecode evaluation loop is " @@ -532,23 +534,23 @@ msgid "" "depending on the system, the compiler, and the benchmark." msgstr "" -#: ../../whatsnew/3.1.rst:442 +#: ../../whatsnew/3.1.rst:443 msgid "" "(Contributed by Antoine Pitrou along with a number of other participants, :" "issue:`4753`)." msgstr "" -#: ../../whatsnew/3.1.rst:445 +#: ../../whatsnew/3.1.rst:446 msgid "" "The decoding of UTF-8, UTF-16 and LATIN-1 is now two to four times faster." msgstr "" -#: ../../whatsnew/3.1.rst:448 +#: ../../whatsnew/3.1.rst:449 msgid "" "(Contributed by Antoine Pitrou and Amaury Forgeot d'Arc, :issue:`4868`.)" msgstr "" -#: ../../whatsnew/3.1.rst:450 +#: ../../whatsnew/3.1.rst:451 msgid "" "The :mod:`json` module now has a C extension to substantially improve its " "performance. In addition, the API was modified so that json works only " @@ -557,45 +559,45 @@ msgid "" "in terms of Unicode." msgstr "" -#: ../../whatsnew/3.1.rst:456 +#: ../../whatsnew/3.1.rst:457 msgid "" "(Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and " "Benjamin Peterson; :issue:`4136`.)" msgstr "" -#: ../../whatsnew/3.1.rst:459 +#: ../../whatsnew/3.1.rst:460 msgid "" "Unpickling now interns the attribute names of pickled objects. This saves " "memory and allows pickles to be smaller." msgstr "" -#: ../../whatsnew/3.1.rst:462 +#: ../../whatsnew/3.1.rst:463 msgid "(Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.)" msgstr "" -#: ../../whatsnew/3.1.rst:465 +#: ../../whatsnew/3.1.rst:466 msgid "IDLE" msgstr "IDLE" -#: ../../whatsnew/3.1.rst:467 +#: ../../whatsnew/3.1.rst:468 msgid "" "IDLE's format menu now provides an option to strip trailing whitespace from " "a source file." msgstr "" -#: ../../whatsnew/3.1.rst:470 +#: ../../whatsnew/3.1.rst:471 msgid "(Contributed by Roger D. Serwy; :issue:`5150`.)" msgstr "" -#: ../../whatsnew/3.1.rst:473 +#: ../../whatsnew/3.1.rst:474 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.1.rst:475 +#: ../../whatsnew/3.1.rst:476 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/3.1.rst:477 +#: ../../whatsnew/3.1.rst:478 msgid "" "Integers are now stored internally either in base ``2**15`` or in base " "``2**30``, the base being determined at build time. Previously, they were " @@ -607,7 +609,7 @@ msgid "" "this default." msgstr "" -#: ../../whatsnew/3.1.rst:486 +#: ../../whatsnew/3.1.rst:487 msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " @@ -616,41 +618,41 @@ msgid "" "type used to store each digit::" msgstr "" -#: ../../whatsnew/3.1.rst:496 +#: ../../whatsnew/3.1.rst:497 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" msgstr "" -#: ../../whatsnew/3.1.rst:498 +#: ../../whatsnew/3.1.rst:499 msgid "" "The :c:func:`PyLong_AsUnsignedLongLong()` function now handles a negative " "*pylong* by raising :exc:`OverflowError` instead of :exc:`TypeError`." msgstr "" -#: ../../whatsnew/3.1.rst:501 +#: ../../whatsnew/3.1.rst:502 msgid "(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)" msgstr "" -#: ../../whatsnew/3.1.rst:503 +#: ../../whatsnew/3.1.rst:504 msgid "" "Deprecated :c:func:`PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." msgstr "" -#: ../../whatsnew/3.1.rst:505 +#: ../../whatsnew/3.1.rst:506 msgid "(Contributed by Mark Dickinson; :issue:`4910`.)" msgstr "" -#: ../../whatsnew/3.1.rst:507 +#: ../../whatsnew/3.1.rst:508 msgid "" "Added a new :c:func:`PyOS_string_to_double` function to replace the " "deprecated functions :c:func:`PyOS_ascii_strtod` and :c:func:" "`PyOS_ascii_atof`." msgstr "" -#: ../../whatsnew/3.1.rst:510 +#: ../../whatsnew/3.1.rst:511 msgid "(Contributed by Mark Dickinson; :issue:`5914`.)" msgstr "" -#: ../../whatsnew/3.1.rst:512 +#: ../../whatsnew/3.1.rst:513 msgid "" "Added :c:type:`PyCapsule` as a replacement for the :c:type:`PyCObject` API. " "The principal difference is that the new type has a well defined interface " @@ -659,27 +661,27 @@ msgid "" "deprecated." msgstr "" -#: ../../whatsnew/3.1.rst:518 +#: ../../whatsnew/3.1.rst:519 msgid "(Contributed by Larry Hastings; :issue:`5630`.)" msgstr "" -#: ../../whatsnew/3.1.rst:521 +#: ../../whatsnew/3.1.rst:522 msgid "Porting to Python 3.1" msgstr "" -#: ../../whatsnew/3.1.rst:523 +#: ../../whatsnew/3.1.rst:524 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/3.1.rst:526 +#: ../../whatsnew/3.1.rst:527 msgid "" "The new floating point string representations can break existing doctests. " "For example::" msgstr "" -#: ../../whatsnew/3.1.rst:549 +#: ../../whatsnew/3.1.rst:550 msgid "" "The automatic name remapping in the pickle module for protocol 2 or lower " "can make Python 3.1 pickles unreadable in Python 3.0. One solution is to " diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 6d5d7f5444..04925cf995 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-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-05-30 00:18+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-" @@ -47,11 +47,10 @@ msgid "Pablo Galindo Salgado" msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.10.rst:49 -msgid "This article explains the new features in Python 3.10, compared to 3.9." -msgstr "" - -#: ../../whatsnew/3.10.rst:51 -msgid "For full details, see the :ref:`changelog `." +msgid "" +"This article explains the new features in Python 3.10, compared to 3.9. " +"Python 3.10 was released on October 4, 2021. For full details, see the :ref:" +"`changelog `." msgstr "" #: ../../whatsnew/3.10.rst:54 diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index a2d3f239f5..12d8613b19 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.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-05-30 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,21 +32,22 @@ msgstr "Raymond Hettinger" #: ../../whatsnew/3.2.rst:51 msgid "" -"This article explains the new features in Python 3.2 as compared to 3.1. It " -"focuses on a few highlights and gives a few examples. For full details, see " -"the `Misc/NEWS `_ file." +"This article explains the new features in Python 3.2 as compared to 3.1. " +"Python 3.2 was released on February 20, 2011. It focuses on a few highlights " +"and gives a few examples. For full details, see the `Misc/NEWS `_ file." msgstr "" -#: ../../whatsnew/3.2.rst:59 +#: ../../whatsnew/3.2.rst:60 msgid ":pep:`392` - Python 3.2 Release Schedule" msgstr "" -#: ../../whatsnew/3.2.rst:63 +#: ../../whatsnew/3.2.rst:64 msgid "PEP 384: Defining a Stable ABI" msgstr "" -#: ../../whatsnew/3.2.rst:65 +#: ../../whatsnew/3.2.rst:66 msgid "" "In the past, extension modules built for one Python version were often not " "usable with other Python versions. Particularly on Windows, every feature " @@ -55,7 +56,7 @@ msgid "" "interpreter internals that extension modules could use." msgstr "" -#: ../../whatsnew/3.2.rst:71 +#: ../../whatsnew/3.2.rst:72 msgid "" "With Python 3.2, an alternative approach becomes available: extension " "modules which restrict themselves to a limited API (by defining " @@ -67,19 +68,19 @@ msgid "" "every feature release." msgstr "" -#: ../../whatsnew/3.2.rst:82 +#: ../../whatsnew/3.2.rst:83 msgid ":pep:`384` - Defining a Stable ABI" msgstr "" -#: ../../whatsnew/3.2.rst:83 +#: ../../whatsnew/3.2.rst:84 msgid "PEP written by Martin von Löwis." msgstr "由 Martin von Löwis 撰寫 PEP。" -#: ../../whatsnew/3.2.rst:87 +#: ../../whatsnew/3.2.rst:88 msgid "PEP 389: Argparse Command Line Parsing Module" msgstr "" -#: ../../whatsnew/3.2.rst:89 +#: ../../whatsnew/3.2.rst:90 msgid "" "A new module for command line parsing, :mod:`argparse`, was introduced to " "overcome the limitations of :mod:`optparse` which did not provide support " @@ -87,7 +88,7 @@ msgid "" "and other common patterns of specifying and validating options." msgstr "" -#: ../../whatsnew/3.2.rst:94 +#: ../../whatsnew/3.2.rst:95 msgid "" "This module has already had widespread success in the community as a third-" "party module. Being more fully featured than its predecessor, the :mod:" @@ -96,46 +97,46 @@ msgid "" "amount of legacy code that depends on it." msgstr "" -#: ../../whatsnew/3.2.rst:100 +#: ../../whatsnew/3.2.rst:101 msgid "" "Here's an annotated example parser showing features like limiting results to " "a set of choices, specifying a *metavar* in the help screen, validating that " "one or more positional arguments is present, and making a required option::" msgstr "" -#: ../../whatsnew/3.2.rst:119 +#: ../../whatsnew/3.2.rst:120 msgid "Example of calling the parser on a command string::" msgstr "" -#: ../../whatsnew/3.2.rst:130 +#: ../../whatsnew/3.2.rst:131 msgid "Example of the parser's automatically generated help::" msgstr "" -#: ../../whatsnew/3.2.rst:149 +#: ../../whatsnew/3.2.rst:150 msgid "" "An especially nice :mod:`argparse` feature is the ability to define " "subparsers, each with their own argument patterns and help displays::" msgstr "" -#: ../../whatsnew/3.2.rst:175 +#: ../../whatsnew/3.2.rst:176 msgid ":pep:`389` - New Command Line Parsing Module" msgstr "" -#: ../../whatsnew/3.2.rst:175 +#: ../../whatsnew/3.2.rst:176 msgid "PEP written by Steven Bethard." msgstr "由 Steven Bethard 撰寫 PEP。" -#: ../../whatsnew/3.2.rst:177 +#: ../../whatsnew/3.2.rst:178 msgid "" ":ref:`upgrading-optparse-code` for details on the differences from :mod:" "`optparse`." msgstr "" -#: ../../whatsnew/3.2.rst:181 +#: ../../whatsnew/3.2.rst:182 msgid "PEP 391: Dictionary Based Configuration for Logging" msgstr "" -#: ../../whatsnew/3.2.rst:183 +#: ../../whatsnew/3.2.rst:184 msgid "" "The :mod:`logging` module provided two kinds of configuration, one style " "with function calls for each option or another style driven by an external " @@ -145,7 +146,7 @@ msgid "" "logger options from a command line." msgstr "" -#: ../../whatsnew/3.2.rst:190 +#: ../../whatsnew/3.2.rst:191 msgid "" "To support a more flexible style, the module now offers :func:`logging." "config.dictConfig` for specifying logging configuration with plain Python " @@ -154,25 +155,25 @@ msgid "" "dictionary::" msgstr "" -#: ../../whatsnew/3.2.rst:214 +#: ../../whatsnew/3.2.rst:215 msgid "" "If that dictionary is stored in a file called :file:`conf.json`, it can be " "loaded and called with code like this::" msgstr "" -#: ../../whatsnew/3.2.rst:229 +#: ../../whatsnew/3.2.rst:230 msgid ":pep:`391` - Dictionary Based Configuration for Logging" msgstr "" -#: ../../whatsnew/3.2.rst:230 +#: ../../whatsnew/3.2.rst:231 msgid "PEP written by Vinay Sajip." msgstr "由 Vinay Sajip 撰寫 PEP。" -#: ../../whatsnew/3.2.rst:234 +#: ../../whatsnew/3.2.rst:235 msgid "PEP 3148: The ``concurrent.futures`` module" msgstr "" -#: ../../whatsnew/3.2.rst:236 +#: ../../whatsnew/3.2.rst:237 msgid "" "Code for creating and managing concurrency is being collected in a new top-" "level namespace, *concurrent*. Its first member is a *futures* package " @@ -180,7 +181,7 @@ msgid "" "processes." msgstr "" -#: ../../whatsnew/3.2.rst:240 +#: ../../whatsnew/3.2.rst:241 msgid "" "The design for :mod:`concurrent.futures` was inspired by the *java.util." "concurrent* package. In that model, a running call and its result are " @@ -190,7 +191,7 @@ msgid "" "adding callbacks, and access to results or exceptions." msgstr "" -#: ../../whatsnew/3.2.rst:247 +#: ../../whatsnew/3.2.rst:248 msgid "" "The primary offering of the new module is a pair of executor classes for " "launching and managing calls. The goal of the executors is to make it " @@ -200,7 +201,7 @@ msgid "" "processes, or remote procedure calls." msgstr "" -#: ../../whatsnew/3.2.rst:254 +#: ../../whatsnew/3.2.rst:255 msgid "" "Ideally, each application should share a single executor across multiple " "components so that process and thread limits can be centrally managed. This " @@ -208,7 +209,7 @@ msgid "" "competing strategy for resource management." msgstr "" -#: ../../whatsnew/3.2.rst:259 +#: ../../whatsnew/3.2.rst:260 msgid "" "Both classes share a common interface with three methods: :meth:`~concurrent." "futures.Executor.submit` for scheduling a callable and returning a :class:" @@ -220,38 +221,38 @@ msgid "" "futures are done executing." msgstr "" -#: ../../whatsnew/3.2.rst:268 +#: ../../whatsnew/3.2.rst:269 msgid "" "A simple of example of :class:`~concurrent.futures.ThreadPoolExecutor` is a " "launch of four parallel threads for copying files::" msgstr "" -#: ../../whatsnew/3.2.rst:281 +#: ../../whatsnew/3.2.rst:282 msgid ":pep:`3148` - Futures -- Execute Computations Asynchronously" msgstr "" -#: ../../whatsnew/3.2.rst:281 +#: ../../whatsnew/3.2.rst:282 msgid "PEP written by Brian Quinlan." msgstr "由 Brian Quinlan 撰寫 PEP。" -#: ../../whatsnew/3.2.rst:283 +#: ../../whatsnew/3.2.rst:284 msgid "" ":ref:`Code for Threaded Parallel URL reads`, an " "example using threads to fetch multiple web pages in parallel." msgstr "" -#: ../../whatsnew/3.2.rst:286 +#: ../../whatsnew/3.2.rst:287 msgid "" ":ref:`Code for computing prime numbers in parallel`, an example demonstrating :class:`~concurrent.futures." "ProcessPoolExecutor`." msgstr "" -#: ../../whatsnew/3.2.rst:292 +#: ../../whatsnew/3.2.rst:293 msgid "PEP 3147: PYC Repository Directories" msgstr "" -#: ../../whatsnew/3.2.rst:294 +#: ../../whatsnew/3.2.rst:295 msgid "" "Python's scheme for caching bytecode in *.pyc* files did not work well in " "environments with multiple Python interpreters. If one interpreter " @@ -260,7 +261,7 @@ msgid "" "caching." msgstr "" -#: ../../whatsnew/3.2.rst:299 +#: ../../whatsnew/3.2.rst:300 msgid "" "The issue of \"pyc fights\" has become more pronounced as it has become " "commonplace for Linux distributions to ship with multiple versions of " @@ -268,7 +269,7 @@ msgid "" "Swallow." msgstr "" -#: ../../whatsnew/3.2.rst:303 +#: ../../whatsnew/3.2.rst:304 msgid "" "To solve this problem, Python's import machinery has been extended to use " "distinct filenames for each interpreter. Instead of Python 3.2 and Python " @@ -279,32 +280,32 @@ msgid "" "\"__pycache__\" directory stored under the package directory." msgstr "" -#: ../../whatsnew/3.2.rst:311 +#: ../../whatsnew/3.2.rst:312 msgid "" "Aside from the filenames and target directories, the new scheme has a few " "aspects that are visible to the programmer:" msgstr "" -#: ../../whatsnew/3.2.rst:314 +#: ../../whatsnew/3.2.rst:315 msgid "" "Imported modules now have a :attr:`__cached__` attribute which stores the " "name of the actual file that was imported:" msgstr "" -#: ../../whatsnew/3.2.rst:321 +#: ../../whatsnew/3.2.rst:322 msgid "" "The tag that is unique to each interpreter is accessible from the :mod:`imp` " "module:" msgstr "" -#: ../../whatsnew/3.2.rst:328 +#: ../../whatsnew/3.2.rst:329 msgid "" "Scripts that try to deduce source filename from the imported file now need " "to be smarter. It is no longer sufficient to simply strip the \"c\" from a " "\".pyc\" filename. Instead, use the new functions in the :mod:`imp` module:" msgstr "" -#: ../../whatsnew/3.2.rst:337 +#: ../../whatsnew/3.2.rst:338 msgid "" "The :mod:`py_compile` and :mod:`compileall` modules have been updated to " "reflect the new naming convention and target directory. The command-line " @@ -313,7 +314,7 @@ msgid "" "be written to their legacy location rather than *__pycache__*." msgstr "" -#: ../../whatsnew/3.2.rst:344 +#: ../../whatsnew/3.2.rst:345 msgid "" "The :mod:`importlib.abc` module has been updated with new :term:`abstract " "base classes ` for loading bytecode files. The " @@ -322,26 +323,26 @@ msgid "" "compatible are included with the documentation)." msgstr "" -#: ../../whatsnew/3.2.rst:352 +#: ../../whatsnew/3.2.rst:353 msgid ":pep:`3147` - PYC Repository Directories" msgstr "" -#: ../../whatsnew/3.2.rst:353 ../../whatsnew/3.2.rst:384 +#: ../../whatsnew/3.2.rst:354 ../../whatsnew/3.2.rst:385 msgid "PEP written by Barry Warsaw." msgstr "由 Barry Warsaw 撰寫 PEP。" -#: ../../whatsnew/3.2.rst:357 +#: ../../whatsnew/3.2.rst:358 msgid "PEP 3149: ABI Version Tagged .so Files" msgstr "" -#: ../../whatsnew/3.2.rst:359 +#: ../../whatsnew/3.2.rst:360 msgid "" "The PYC repository directory allows multiple bytecode cache files to be co-" "located. This PEP implements a similar mechanism for shared object files by " "giving them a common directory and distinct names for each version." msgstr "" -#: ../../whatsnew/3.2.rst:363 +#: ../../whatsnew/3.2.rst:364 msgid "" "The common directory is \"pyshared\" and the file names are made distinct by " "identifying the Python implementation (such as CPython, PyPy, Jython, etc.), " @@ -351,21 +352,21 @@ msgid "" "installed::" msgstr "" -#: ../../whatsnew/3.2.rst:372 +#: ../../whatsnew/3.2.rst:373 msgid "" "In Python itself, the tags are accessible from functions in the :mod:" "`sysconfig` module::" msgstr "" -#: ../../whatsnew/3.2.rst:383 +#: ../../whatsnew/3.2.rst:384 msgid ":pep:`3149` - ABI Version Tagged .so Files" msgstr "" -#: ../../whatsnew/3.2.rst:388 +#: ../../whatsnew/3.2.rst:389 msgid "PEP 3333: Python Web Server Gateway Interface v1.0.1" msgstr "" -#: ../../whatsnew/3.2.rst:390 +#: ../../whatsnew/3.2.rst:391 msgid "" "This informational PEP clarifies how bytes/text issues are to be handled by " "the WSGI protocol. The challenge is that string handling in Python 3 is " @@ -373,14 +374,14 @@ msgid "" "protocol is itself bytes oriented." msgstr "" -#: ../../whatsnew/3.2.rst:395 +#: ../../whatsnew/3.2.rst:396 msgid "" "The PEP differentiates so-called *native strings* that are used for request/" "response headers and metadata versus *byte strings* which are used for the " "bodies of requests and responses." msgstr "" -#: ../../whatsnew/3.2.rst:399 +#: ../../whatsnew/3.2.rst:400 msgid "" "The *native strings* are always of type :class:`str` but are restricted to " "code points between *U+0000* through *U+00FF* which are translatable to " @@ -391,18 +392,18 @@ msgid "" "use :rfc:`2047` MIME encoding." msgstr "" -#: ../../whatsnew/3.2.rst:407 +#: ../../whatsnew/3.2.rst:408 msgid "" "For developers porting WSGI applications from Python 2, here are the salient " "points:" msgstr "" -#: ../../whatsnew/3.2.rst:410 +#: ../../whatsnew/3.2.rst:411 msgid "" "If the app already used strings for headers in Python 2, no change is needed." msgstr "" -#: ../../whatsnew/3.2.rst:412 +#: ../../whatsnew/3.2.rst:413 msgid "" "If instead, the app encoded output headers or decoded input headers, then " "the headers will need to be re-encoded to Latin-1. For example, an output " @@ -410,14 +411,14 @@ msgid "" "from bytes to native strings using ``h.encode('utf-8').decode('latin-1')``." msgstr "" -#: ../../whatsnew/3.2.rst:417 +#: ../../whatsnew/3.2.rst:418 msgid "" "Values yielded by an application or sent using the :meth:`write` method must " "be byte strings. The :func:`start_response` function and environ must use " "native strings. The two cannot be mixed." msgstr "" -#: ../../whatsnew/3.2.rst:421 +#: ../../whatsnew/3.2.rst:422 msgid "" "For server implementers writing CGI-to-WSGI pathways or other CGI-style " "protocols, the users must to be able access the environment using native " @@ -428,23 +429,23 @@ msgid "" "dictionary." msgstr "" -#: ../../whatsnew/3.2.rst:430 +#: ../../whatsnew/3.2.rst:431 msgid ":pep:`3333` - Python Web Server Gateway Interface v1.0.1" msgstr "" -#: ../../whatsnew/3.2.rst:431 +#: ../../whatsnew/3.2.rst:432 msgid "PEP written by Phillip Eby." msgstr "由 Phillip Eby 撰寫 PEP。" -#: ../../whatsnew/3.2.rst:435 +#: ../../whatsnew/3.2.rst:436 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.2.rst:437 +#: ../../whatsnew/3.2.rst:438 msgid "Some smaller changes made to the core Python language are:" msgstr "" -#: ../../whatsnew/3.2.rst:439 +#: ../../whatsnew/3.2.rst:440 msgid "" "String formatting for :func:`format` and :meth:`str.format` gained new " "capabilities for the format character **#**. Previously, for integers in " @@ -454,12 +455,12 @@ msgid "" "digits follow it." msgstr "" -#: ../../whatsnew/3.2.rst:451 +#: ../../whatsnew/3.2.rst:452 msgid "" "(Suggested by Mark Dickinson and implemented by Eric Smith in :issue:`7094`.)" msgstr "" -#: ../../whatsnew/3.2.rst:453 +#: ../../whatsnew/3.2.rst:454 msgid "" "There is also a new :meth:`str.format_map` method that extends the " "capabilities of the existing :meth:`str.format` method by accepting " @@ -471,13 +472,13 @@ msgid "" "meth:`__missing__` method for unknown keys::" msgstr "" -#: ../../whatsnew/3.2.rst:480 +#: ../../whatsnew/3.2.rst:481 msgid "" "(Suggested by Raymond Hettinger and implemented by Eric Smith in :issue:" "`6081`.)" msgstr "" -#: ../../whatsnew/3.2.rst:483 +#: ../../whatsnew/3.2.rst:484 msgid "" "The interpreter can now be started with a quiet option, ``-q``, to prevent " "the copyright and version information from being displayed in the " @@ -485,11 +486,11 @@ msgid "" "flags` attribute:" msgstr "" -#: ../../whatsnew/3.2.rst:495 +#: ../../whatsnew/3.2.rst:496 msgid "(Contributed by Marcin Wojdyr in :issue:`1772833`)." msgstr "" -#: ../../whatsnew/3.2.rst:497 +#: ../../whatsnew/3.2.rst:498 msgid "" "The :func:`hasattr` function works by calling :func:`getattr` and detecting " "whether an exception is raised. This technique allows it to detect methods " @@ -500,12 +501,12 @@ msgid "" "exceptions pass through::" msgstr "" -#: ../../whatsnew/3.2.rst:516 +#: ../../whatsnew/3.2.rst:517 msgid "" "(Discovered by Yury Selivanov and fixed by Benjamin Peterson; :issue:`9666`.)" msgstr "" -#: ../../whatsnew/3.2.rst:518 +#: ../../whatsnew/3.2.rst:519 msgid "" "The :func:`str` of a float or complex number is now the same as its :func:" "`repr`. Previously, the :func:`str` form was shorter but that just caused " @@ -513,11 +514,11 @@ msgid "" "`repr` is displayed by default:" msgstr "" -#: ../../whatsnew/3.2.rst:529 +#: ../../whatsnew/3.2.rst:530 msgid "(Proposed and implemented by Mark Dickinson; :issue:`9337`.)" msgstr "" -#: ../../whatsnew/3.2.rst:531 +#: ../../whatsnew/3.2.rst:532 msgid "" ":class:`memoryview` objects now have a :meth:`~memoryview.release()` method " "and they also now support the context management protocol. This allows " @@ -525,28 +526,28 @@ msgid "" "from the original object." msgstr "" -#: ../../whatsnew/3.2.rst:540 +#: ../../whatsnew/3.2.rst:541 msgid "(Added by Antoine Pitrou; :issue:`9757`.)" msgstr "" -#: ../../whatsnew/3.2.rst:542 +#: ../../whatsnew/3.2.rst:543 msgid "" "Previously it was illegal to delete a name from the local namespace if it " "occurs as a free variable in a nested block::" msgstr "" -#: ../../whatsnew/3.2.rst:551 +#: ../../whatsnew/3.2.rst:552 msgid "" "This is now allowed. Remember that the target of an :keyword:`except` " "clause is cleared, so this code which used to work with Python 2.6, raised " "a :exc:`SyntaxError` with Python 3.1 and now works again::" msgstr "" -#: ../../whatsnew/3.2.rst:564 +#: ../../whatsnew/3.2.rst:565 msgid "(See :issue:`4617`.)" msgstr "(請見 :issue:`4617`\\ 。)" -#: ../../whatsnew/3.2.rst:566 +#: ../../whatsnew/3.2.rst:567 msgid "" "The internal :c:type:`structsequence` tool now creates subclasses of tuple. " "This means that C structures like those returned by :func:`os.stat`, :func:" @@ -556,25 +557,25 @@ msgid "" "as their pure Python counterparts:" msgstr "" -#: ../../whatsnew/3.2.rst:579 +#: ../../whatsnew/3.2.rst:580 msgid "" "(Suggested by Arfrever Frehtes Taifersar Arahesis and implemented by " "Benjamin Peterson in :issue:`8413`.)" msgstr "" -#: ../../whatsnew/3.2.rst:582 +#: ../../whatsnew/3.2.rst:583 msgid "" "Warnings are now easier to control using the :envvar:`PYTHONWARNINGS` " "environment variable as an alternative to using ``-W`` at the command line:" msgstr "" -#: ../../whatsnew/3.2.rst:589 +#: ../../whatsnew/3.2.rst:590 msgid "" "(Suggested by Barry Warsaw and implemented by Philip Jenvey in :issue:" "`7301`.)" msgstr "" -#: ../../whatsnew/3.2.rst:591 +#: ../../whatsnew/3.2.rst:592 msgid "" "A new warning category, :exc:`ResourceWarning`, has been added. It is " "emitted when potential issues with resource consumption or cleanup are " @@ -583,7 +584,7 @@ msgid "" "command line." msgstr "" -#: ../../whatsnew/3.2.rst:597 +#: ../../whatsnew/3.2.rst:598 msgid "" "A :exc:`ResourceWarning` is issued at interpreter shutdown if the :data:`gc." "garbage` list isn't empty, and if :attr:`gc.DEBUG_UNCOLLECTABLE` is set, all " @@ -591,7 +592,7 @@ msgid "" "aware that their code contains object finalization issues." msgstr "" -#: ../../whatsnew/3.2.rst:602 +#: ../../whatsnew/3.2.rst:603 msgid "" "A :exc:`ResourceWarning` is also issued when a :term:`file object` is " "destroyed without having been explicitly closed. While the deallocator for " @@ -601,13 +602,13 @@ msgid "" "enabling the warning from the command line:" msgstr "" -#: ../../whatsnew/3.2.rst:616 +#: ../../whatsnew/3.2.rst:617 msgid "" "(Added by Antoine Pitrou and Georg Brandl in :issue:`10093` and :issue:" "`477863`.)" msgstr "" -#: ../../whatsnew/3.2.rst:618 +#: ../../whatsnew/3.2.rst:619 msgid "" ":class:`range` objects now support *index* and *count* methods. This is part " "of an effort to make more objects fully implement the :class:`collections." @@ -617,45 +618,45 @@ msgid "" "This makes *range* more interoperable with lists::" msgstr "" -#: ../../whatsnew/3.2.rst:634 +#: ../../whatsnew/3.2.rst:635 msgid "" "(Contributed by Daniel Stutzbach in :issue:`9213`, by Alexander Belopolsky " "in :issue:`2690`, and by Nick Coghlan in :issue:`10889`.)" msgstr "" -#: ../../whatsnew/3.2.rst:637 +#: ../../whatsnew/3.2.rst:638 msgid "" "The :func:`callable` builtin function from Py2.x was resurrected. It " "provides a concise, readable alternative to using an :term:`abstract base " "class` in an expression like ``isinstance(x, collections.Callable)``:" msgstr "" -#: ../../whatsnew/3.2.rst:646 +#: ../../whatsnew/3.2.rst:647 msgid "(See :issue:`10518`.)" msgstr "(請見 :issue:`10518`\\ 。)" -#: ../../whatsnew/3.2.rst:648 +#: ../../whatsnew/3.2.rst:649 msgid "" "Python's import mechanism can now load modules installed in directories with " "non-ASCII characters in the path name. This solved an aggravating problem " "with home directories for users with non-ASCII characters in their usernames." msgstr "" -#: ../../whatsnew/3.2.rst:652 +#: ../../whatsnew/3.2.rst:653 msgid "(Required extensive work by Victor Stinner in :issue:`9425`.)" msgstr "" -#: ../../whatsnew/3.2.rst:656 +#: ../../whatsnew/3.2.rst:657 msgid "New, Improved, and Deprecated Modules" msgstr "" -#: ../../whatsnew/3.2.rst:658 +#: ../../whatsnew/3.2.rst:659 msgid "" "Python's standard library has undergone significant maintenance efforts and " "quality improvements." msgstr "" -#: ../../whatsnew/3.2.rst:661 +#: ../../whatsnew/3.2.rst:662 msgid "" "The biggest news for Python 3.2 is that the :mod:`email` package, :mod:" "`mailbox` module, and :mod:`nntplib` modules now work correctly with the " @@ -663,7 +664,7 @@ msgid "" "of messages with mixed encodings." msgstr "" -#: ../../whatsnew/3.2.rst:666 +#: ../../whatsnew/3.2.rst:667 msgid "" "Throughout the standard library, there has been more careful attention to " "encodings and text versus bytes issues. In particular, interactions with " @@ -671,23 +672,23 @@ msgid "" "the Windows MBCS encoding, locale-aware encodings, or UTF-8." msgstr "" -#: ../../whatsnew/3.2.rst:671 +#: ../../whatsnew/3.2.rst:672 msgid "" "Another significant win is the addition of substantially better support for " "*SSL* connections and security certificates." msgstr "" -#: ../../whatsnew/3.2.rst:674 +#: ../../whatsnew/3.2.rst:675 msgid "" "In addition, more classes now implement a :term:`context manager` to support " "convenient and reliable resource clean-up using a :keyword:`with` statement." msgstr "" -#: ../../whatsnew/3.2.rst:678 +#: ../../whatsnew/3.2.rst:679 msgid "email" msgstr "email" -#: ../../whatsnew/3.2.rst:680 +#: ../../whatsnew/3.2.rst:681 msgid "" "The usability of the :mod:`email` package in Python 3 has been mostly fixed " "by the extensive efforts of R. David Murray. The problem was that emails " @@ -697,7 +698,7 @@ msgid "" "messages in bytes format." msgstr "" -#: ../../whatsnew/3.2.rst:687 +#: ../../whatsnew/3.2.rst:688 msgid "" "New functions :func:`~email.message_from_bytes` and :func:`~email." "message_from_binary_file`, and new classes :class:`~email.parser." @@ -705,7 +706,7 @@ msgid "" "data to be parsed into model objects." msgstr "" -#: ../../whatsnew/3.2.rst:692 +#: ../../whatsnew/3.2.rst:693 msgid "" "Given bytes input to the model, :meth:`~email.message.Message.get_payload` " "will by default decode a message body that has a :mailheader:`Content-" @@ -713,20 +714,20 @@ msgid "" "and return the resulting string." msgstr "" -#: ../../whatsnew/3.2.rst:697 +#: ../../whatsnew/3.2.rst:698 msgid "" "Given bytes input to the model, :class:`~email.generator.Generator` will " "convert message bodies that have a :mailheader:`Content-Transfer-Encoding` " "of *8bit* to instead have a *7bit* :mailheader:`Content-Transfer-Encoding`." msgstr "" -#: ../../whatsnew/3.2.rst:701 +#: ../../whatsnew/3.2.rst:702 msgid "" "Headers with unencoded non-ASCII bytes are deemed to be :rfc:`2047`\\ -" "encoded using the *unknown-8bit* character set." msgstr "" -#: ../../whatsnew/3.2.rst:704 +#: ../../whatsnew/3.2.rst:705 msgid "" "A new class :class:`~email.generator.BytesGenerator` produces bytes as " "output, preserving any unchanged non-ASCII data that was present in the " @@ -734,7 +735,7 @@ msgid "" "`Content-Transfer-Encoding` of *8bit*." msgstr "" -#: ../../whatsnew/3.2.rst:709 +#: ../../whatsnew/3.2.rst:710 msgid "" "The :mod:`smtplib` :class:`~smtplib.SMTP` class now accepts a byte string " "for the *msg* argument to the :meth:`~smtplib.SMTP.sendmail` method, and a " @@ -743,126 +744,126 @@ msgid "" "*to_addrs* addresses directly from the object." msgstr "" -#: ../../whatsnew/3.2.rst:715 +#: ../../whatsnew/3.2.rst:716 msgid "" "(Proposed and implemented by R. David Murray, :issue:`4661` and :issue:" "`10321`.)" msgstr "" -#: ../../whatsnew/3.2.rst:718 +#: ../../whatsnew/3.2.rst:719 msgid "elementtree" msgstr "elementtree" -#: ../../whatsnew/3.2.rst:720 +#: ../../whatsnew/3.2.rst:721 msgid "" "The :mod:`xml.etree.ElementTree` package and its :mod:`xml.etree." "cElementTree` counterpart have been updated to version 1.3." msgstr "" -#: ../../whatsnew/3.2.rst:723 +#: ../../whatsnew/3.2.rst:724 msgid "Several new and useful functions and methods have been added:" msgstr "" -#: ../../whatsnew/3.2.rst:725 +#: ../../whatsnew/3.2.rst:726 msgid "" ":func:`xml.etree.ElementTree.fromstringlist` which builds an XML document " "from a sequence of fragments" msgstr "" -#: ../../whatsnew/3.2.rst:727 +#: ../../whatsnew/3.2.rst:728 msgid "" ":func:`xml.etree.ElementTree.register_namespace` for registering a global " "namespace prefix" msgstr "" -#: ../../whatsnew/3.2.rst:729 +#: ../../whatsnew/3.2.rst:730 msgid "" ":func:`xml.etree.ElementTree.tostringlist` for string representation " "including all sublists" msgstr "" -#: ../../whatsnew/3.2.rst:731 +#: ../../whatsnew/3.2.rst:732 msgid "" ":meth:`xml.etree.ElementTree.Element.extend` for appending a sequence of " "zero or more elements" msgstr "" -#: ../../whatsnew/3.2.rst:733 +#: ../../whatsnew/3.2.rst:734 msgid "" ":meth:`xml.etree.ElementTree.Element.iterfind` searches an element and " "subelements" msgstr "" -#: ../../whatsnew/3.2.rst:735 +#: ../../whatsnew/3.2.rst:736 msgid "" ":meth:`xml.etree.ElementTree.Element.itertext` creates a text iterator over " "an element and its subelements" msgstr "" -#: ../../whatsnew/3.2.rst:737 +#: ../../whatsnew/3.2.rst:738 msgid "" ":meth:`xml.etree.ElementTree.TreeBuilder.end` closes the current element" msgstr "" -#: ../../whatsnew/3.2.rst:738 +#: ../../whatsnew/3.2.rst:739 msgid "" ":meth:`xml.etree.ElementTree.TreeBuilder.doctype` handles a doctype " "declaration" msgstr "" -#: ../../whatsnew/3.2.rst:741 +#: ../../whatsnew/3.2.rst:742 msgid "Two methods have been deprecated:" msgstr "" -#: ../../whatsnew/3.2.rst:743 +#: ../../whatsnew/3.2.rst:744 msgid ":meth:`xml.etree.ElementTree.getchildren` use ``list(elem)`` instead." msgstr "" -#: ../../whatsnew/3.2.rst:744 +#: ../../whatsnew/3.2.rst:745 msgid ":meth:`xml.etree.ElementTree.getiterator` use ``Element.iter`` instead." msgstr "" -#: ../../whatsnew/3.2.rst:746 +#: ../../whatsnew/3.2.rst:747 msgid "" "For details of the update, see `Introducing ElementTree `_ on " "Fredrik Lundh's website." msgstr "" -#: ../../whatsnew/3.2.rst:750 +#: ../../whatsnew/3.2.rst:751 msgid "(Contributed by Florent Xicluna and Fredrik Lundh, :issue:`6472`.)" msgstr "" -#: ../../whatsnew/3.2.rst:753 +#: ../../whatsnew/3.2.rst:754 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.2.rst:755 +#: ../../whatsnew/3.2.rst:756 msgid "" "The :mod:`functools` module includes a new decorator for caching function " "calls. :func:`functools.lru_cache` can save repeated queries to an external " "resource whenever the results are expected to be the same." msgstr "" -#: ../../whatsnew/3.2.rst:759 +#: ../../whatsnew/3.2.rst:760 msgid "" "For example, adding a caching decorator to a database query function can " "save database accesses for popular searches:" msgstr "" -#: ../../whatsnew/3.2.rst:772 +#: ../../whatsnew/3.2.rst:773 msgid "" "To help with choosing an effective cache size, the wrapped function is " "instrumented for tracking cache statistics:" msgstr "" -#: ../../whatsnew/3.2.rst:778 +#: ../../whatsnew/3.2.rst:779 msgid "" "If the phonelist table gets updated, the outdated contents of the cache can " "be cleared with:" msgstr "" -#: ../../whatsnew/3.2.rst:783 +#: ../../whatsnew/3.2.rst:784 msgid "" "(Contributed by Raymond Hettinger and incorporating design ideas from Jim " "Baker, Miki Tebeka, and Nick Coghlan; see `recipe 498245 `_\\, :issue:`10586`, and :issue:`10593`.)" msgstr "" -#: ../../whatsnew/3.2.rst:789 +#: ../../whatsnew/3.2.rst:790 msgid "" "The :func:`functools.wraps` decorator now adds a :attr:`__wrapped__` " "attribute pointing to the original callable function. This allows wrapped " @@ -879,84 +880,84 @@ msgid "" "attr:`__doc__` which might not be defined for the wrapped callable." msgstr "" -#: ../../whatsnew/3.2.rst:795 +#: ../../whatsnew/3.2.rst:796 msgid "" "In the above example, the cache can be removed by recovering the original " "function:" msgstr "" -#: ../../whatsnew/3.2.rst:800 +#: ../../whatsnew/3.2.rst:801 msgid "" "(By Nick Coghlan and Terrence Cole; :issue:`9567`, :issue:`3445`, and :issue:" "`8814`.)" msgstr "" -#: ../../whatsnew/3.2.rst:803 +#: ../../whatsnew/3.2.rst:804 msgid "" "To help write classes with rich comparison methods, a new decorator :func:" "`functools.total_ordering` will use existing equality and inequality methods " "to fill in the remaining methods." msgstr "" -#: ../../whatsnew/3.2.rst:807 +#: ../../whatsnew/3.2.rst:808 msgid "" "For example, supplying *__eq__* and *__lt__* will enable :func:`~functools." "total_ordering` to fill-in *__le__*, *__gt__* and *__ge__*::" msgstr "" -#: ../../whatsnew/3.2.rst:820 +#: ../../whatsnew/3.2.rst:821 msgid "" "With the *total_ordering* decorator, the remaining comparison methods are " "filled in automatically." msgstr "" -#: ../../whatsnew/3.2.rst:823 ../../whatsnew/3.2.rst:835 -#: ../../whatsnew/3.2.rst:879 ../../whatsnew/3.2.rst:900 -#: ../../whatsnew/3.2.rst:914 ../../whatsnew/3.2.rst:1784 -#: ../../whatsnew/3.2.rst:1829 +#: ../../whatsnew/3.2.rst:824 ../../whatsnew/3.2.rst:836 +#: ../../whatsnew/3.2.rst:880 ../../whatsnew/3.2.rst:901 +#: ../../whatsnew/3.2.rst:915 ../../whatsnew/3.2.rst:1785 +#: ../../whatsnew/3.2.rst:1830 msgid "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/3.2.rst:825 +#: ../../whatsnew/3.2.rst:826 msgid "" "To aid in porting programs from Python 2, the :func:`functools.cmp_to_key` " "function converts an old-style comparison function to modern :term:`key " "function`:" msgstr "" -#: ../../whatsnew/3.2.rst:832 +#: ../../whatsnew/3.2.rst:833 msgid "" "For sorting examples and a brief sorting tutorial, see the `Sorting HowTo " "`_ tutorial." msgstr "" -#: ../../whatsnew/3.2.rst:838 +#: ../../whatsnew/3.2.rst:839 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.2.rst:840 +#: ../../whatsnew/3.2.rst:841 msgid "" "The :mod:`itertools` module has a new :func:`~itertools.accumulate` function " "modeled on APL's *scan* operator and Numpy's *accumulate* function:" msgstr "" -#: ../../whatsnew/3.2.rst:851 +#: ../../whatsnew/3.2.rst:852 msgid "" "For an example using :func:`~itertools.accumulate`, see the :ref:`examples " "for the random module `." msgstr "" -#: ../../whatsnew/3.2.rst:854 +#: ../../whatsnew/3.2.rst:855 msgid "" "(Contributed by Raymond Hettinger and incorporating design suggestions from " "Mark Dickinson.)" msgstr "" -#: ../../whatsnew/3.2.rst:858 +#: ../../whatsnew/3.2.rst:859 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.2.rst:860 +#: ../../whatsnew/3.2.rst:861 msgid "" "The :class:`collections.Counter` class now has two forms of in-place " "subtraction, the existing *-=* operator for `saturating subtraction `_ which is defined for only two threads." msgstr "" -#: ../../whatsnew/3.2.rst:929 +#: ../../whatsnew/3.2.rst:930 msgid "" "Implemented as a two-phase cyclic barrier, :class:`~threading.Barrier` " "objects are suitable for use in loops. The separate *filling* and " @@ -1023,11 +1024,11 @@ msgid "" "resets after each cycle." msgstr "" -#: ../../whatsnew/3.2.rst:934 +#: ../../whatsnew/3.2.rst:935 msgid "Example of using barriers::" msgstr "" -#: ../../whatsnew/3.2.rst:948 +#: ../../whatsnew/3.2.rst:949 msgid "" "In this example, the barrier enforces a rule that votes cannot be counted at " "any polling site until all polls are closed. Notice how a solution with a " @@ -1036,7 +1037,7 @@ msgid "" "barrier point is crossed." msgstr "" -#: ../../whatsnew/3.2.rst:954 +#: ../../whatsnew/3.2.rst:955 msgid "" "If any of the predecessor tasks can hang or be delayed, a barrier can be " "created with an optional *timeout* parameter. Then if the timeout period " @@ -1045,14 +1046,14 @@ msgid "" "exception is raised::" msgstr "" -#: ../../whatsnew/3.2.rst:970 +#: ../../whatsnew/3.2.rst:971 msgid "" "In this example, the barrier enforces a more robust rule. If some election " "sites do not finish before midnight, the barrier times-out and the ballots " "are sealed and deposited in a queue for later handling." msgstr "" -#: ../../whatsnew/3.2.rst:974 +#: ../../whatsnew/3.2.rst:975 msgid "" "See `Barrier Synchronization Patterns `_ for more examples " @@ -1062,17 +1063,17 @@ msgid "" "*section 3.6*." msgstr "" -#: ../../whatsnew/3.2.rst:980 +#: ../../whatsnew/3.2.rst:981 msgid "" "(Contributed by Kristján Valur Jónsson with an API review by Jeffrey Yasskin " "in :issue:`8777`.)" msgstr "" -#: ../../whatsnew/3.2.rst:984 +#: ../../whatsnew/3.2.rst:985 msgid "datetime and time" msgstr "datetime 和 time" -#: ../../whatsnew/3.2.rst:986 +#: ../../whatsnew/3.2.rst:987 msgid "" "The :mod:`datetime` module has a new type :class:`~datetime.timezone` that " "implements the :class:`~datetime.tzinfo` interface by returning a fixed UTC " @@ -1080,20 +1081,20 @@ msgid "" "datetime objects::" msgstr "" -#: ../../whatsnew/3.2.rst:999 +#: ../../whatsnew/3.2.rst:1000 msgid "" "Also, :class:`~datetime.timedelta` objects can now be multiplied by :class:" "`float` and divided by :class:`float` and :class:`int` objects. And :class:" "`~datetime.timedelta` objects can now divide one another." msgstr "" -#: ../../whatsnew/3.2.rst:1003 +#: ../../whatsnew/3.2.rst:1004 msgid "" "The :meth:`datetime.date.strftime` method is no longer restricted to years " "after 1900. The new supported year range is from 1000 to 9999 inclusive." msgstr "" -#: ../../whatsnew/3.2.rst:1006 +#: ../../whatsnew/3.2.rst:1007 msgid "" "Whenever a two-digit year is used in a time tuple, the interpretation has " "been governed by :attr:`time.accept2dyear`. The default is ``True`` which " @@ -1101,7 +1102,7 @@ msgid "" "POSIX rules governing the ``%y`` strptime format." msgstr "" -#: ../../whatsnew/3.2.rst:1011 +#: ../../whatsnew/3.2.rst:1012 msgid "" "Starting with Py3.2, use of the century guessing heuristic will emit a :exc:" "`DeprecationWarning`. Instead, it is recommended that :attr:`time." @@ -1109,7 +1110,7 @@ msgid "" "without guesswork::" msgstr "" -#: ../../whatsnew/3.2.rst:1030 +#: ../../whatsnew/3.2.rst:1031 msgid "" "Several functions now have significantly expanded date ranges. When :attr:" "`time.accept2dyear` is false, the :func:`time.asctime` function will accept " @@ -1118,45 +1119,45 @@ msgid "" "corresponding operating system functions." msgstr "" -#: ../../whatsnew/3.2.rst:1036 +#: ../../whatsnew/3.2.rst:1037 msgid "" "(Contributed by Alexander Belopolsky and Victor Stinner in :issue:" "`1289118`, :issue:`5094`, :issue:`6641`, :issue:`2706`, :issue:`1777412`, :" "issue:`8013`, and :issue:`10827`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1043 +#: ../../whatsnew/3.2.rst:1044 msgid "math" msgstr "math" -#: ../../whatsnew/3.2.rst:1045 +#: ../../whatsnew/3.2.rst:1046 msgid "" "The :mod:`math` module has been updated with six new functions inspired by " "the C99 standard." msgstr "" -#: ../../whatsnew/3.2.rst:1048 +#: ../../whatsnew/3.2.rst:1049 msgid "" "The :func:`~math.isfinite` function provides a reliable and fast way to " "detect special values. It returns ``True`` for regular numbers and " "``False`` for *Nan* or *Infinity*:" msgstr "" -#: ../../whatsnew/3.2.rst:1056 +#: ../../whatsnew/3.2.rst:1057 msgid "" "The :func:`~math.expm1` function computes ``e**x-1`` for small values of *x* " "without incurring the loss of precision that usually accompanies the " "subtraction of nearly equal quantities:" msgstr "" -#: ../../whatsnew/3.2.rst:1064 +#: ../../whatsnew/3.2.rst:1065 msgid "" "The :func:`~math.erf` function computes a probability integral or `Gaussian " "error function `_. The " "complementary error function, :func:`~math.erfc`, is ``1 - erf(x)``:" msgstr "" -#: ../../whatsnew/3.2.rst:1079 +#: ../../whatsnew/3.2.rst:1080 msgid "" "The :func:`~math.gamma` function is a continuous extension of the factorial " "function. See https://en.wikipedia.org/wiki/Gamma_function for details. " @@ -1165,36 +1166,36 @@ msgid "" "computing the natural logarithm of the gamma function:" msgstr "" -#: ../../whatsnew/3.2.rst:1091 +#: ../../whatsnew/3.2.rst:1092 msgid "(Contributed by Mark Dickinson.)" msgstr "" -#: ../../whatsnew/3.2.rst:1094 +#: ../../whatsnew/3.2.rst:1095 msgid "abc" msgstr "abc" -#: ../../whatsnew/3.2.rst:1096 +#: ../../whatsnew/3.2.rst:1097 msgid "" "The :mod:`abc` module now supports :func:`~abc.abstractclassmethod` and :" "func:`~abc.abstractstaticmethod`." msgstr "" -#: ../../whatsnew/3.2.rst:1099 +#: ../../whatsnew/3.2.rst:1100 msgid "" "These tools make it possible to define an :term:`abstract base class` that " "requires a particular :func:`classmethod` or :func:`staticmethod` to be " "implemented::" msgstr "" -#: ../../whatsnew/3.2.rst:1111 +#: ../../whatsnew/3.2.rst:1112 msgid "(Patch submitted by Daniel Urban; :issue:`5867`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1114 +#: ../../whatsnew/3.2.rst:1115 msgid "io" msgstr "io" -#: ../../whatsnew/3.2.rst:1116 +#: ../../whatsnew/3.2.rst:1117 msgid "" "The :class:`io.BytesIO` has a new method, :meth:`~io.BytesIO.getbuffer`, " "which provides functionality similar to :func:`memoryview`. It creates an " @@ -1202,15 +1203,15 @@ msgid "" "and support for slice notation are well-suited to in-place editing::" msgstr "" -#: ../../whatsnew/3.2.rst:1142 +#: ../../whatsnew/3.2.rst:1143 msgid "(Contributed by Antoine Pitrou in :issue:`5506`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1145 +#: ../../whatsnew/3.2.rst:1146 msgid "reprlib" msgstr "reprlib" -#: ../../whatsnew/3.2.rst:1147 +#: ../../whatsnew/3.2.rst:1148 msgid "" "When writing a :meth:`__repr__` method for a custom container, it is easy to " "forget to handle the case where a member refers back to the container " @@ -1219,28 +1220,28 @@ msgid "" "representation string." msgstr "" -#: ../../whatsnew/3.2.rst:1153 +#: ../../whatsnew/3.2.rst:1154 msgid "" "To help write such :meth:`__repr__` methods, the :mod:`reprlib` module has a " "new decorator, :func:`~reprlib.recursive_repr`, for detecting recursive " "calls to :meth:`__repr__` and substituting a placeholder string instead::" msgstr "" -#: ../../whatsnew/3.2.rst:1168 +#: ../../whatsnew/3.2.rst:1169 msgid "(Contributed by Raymond Hettinger in :issue:`9826` and :issue:`9840`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1171 +#: ../../whatsnew/3.2.rst:1172 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.2.rst:1173 +#: ../../whatsnew/3.2.rst:1174 msgid "" "In addition to dictionary-based configuration described above, the :mod:" "`logging` package has many other improvements." msgstr "" -#: ../../whatsnew/3.2.rst:1176 +#: ../../whatsnew/3.2.rst:1177 msgid "" "The logging documentation has been augmented by a :ref:`basic tutorial " "`\\, an :ref:`advanced tutorial ` for zipfiles, uncompressed tarfiles, " @@ -1665,7 +1666,7 @@ msgid "" "tarfiles or custom formats)." msgstr "" -#: ../../whatsnew/3.2.rst:1557 +#: ../../whatsnew/3.2.rst:1558 msgid "" "The principal functions are :func:`~shutil.make_archive` and :func:`~shutil." "unpack_archive`. By default, both operate on the current directory (which " @@ -1674,23 +1675,23 @@ msgid "" "non-destructive (the original files are left unchanged)." msgstr "" -#: ../../whatsnew/3.2.rst:1591 +#: ../../whatsnew/3.2.rst:1592 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.2.rst:1593 +#: ../../whatsnew/3.2.rst:1594 msgid "" "The :mod:`sqlite3` module was updated to pysqlite version 2.6.0. It has two " "new capabilities." msgstr "" -#: ../../whatsnew/3.2.rst:1595 +#: ../../whatsnew/3.2.rst:1596 msgid "" "The :attr:`sqlite3.Connection.in_transit` attribute is true if there is an " "active transaction for uncommitted changes." msgstr "" -#: ../../whatsnew/3.2.rst:1598 +#: ../../whatsnew/3.2.rst:1599 msgid "" "The :meth:`sqlite3.Connection.enable_load_extension` and :meth:`sqlite3." "Connection.load_extension` methods allows you to load SQLite extensions from " @@ -1698,30 +1699,30 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../whatsnew/3.2.rst:1603 +#: ../../whatsnew/3.2.rst:1604 msgid "(Contributed by R. David Murray and Shashwat Anand; :issue:`8845`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1606 +#: ../../whatsnew/3.2.rst:1607 msgid "html" msgstr "html" -#: ../../whatsnew/3.2.rst:1608 +#: ../../whatsnew/3.2.rst:1609 msgid "" "A new :mod:`html` module was introduced with only a single function, :func:" "`~html.escape`, which is used for escaping reserved characters from HTML " "markup:" msgstr "" -#: ../../whatsnew/3.2.rst:1617 +#: ../../whatsnew/3.2.rst:1618 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.2.rst:1619 +#: ../../whatsnew/3.2.rst:1620 msgid "The :mod:`socket` module has two new improvements." msgstr "" -#: ../../whatsnew/3.2.rst:1621 +#: ../../whatsnew/3.2.rst:1622 msgid "" "Socket objects now have a :meth:`~socket.socket.detach()` method which puts " "the socket into closed state without actually closing the underlying file " @@ -1729,24 +1730,24 @@ msgid "" "Antoine Pitrou; :issue:`8524`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1626 +#: ../../whatsnew/3.2.rst:1627 msgid "" ":func:`socket.create_connection` now supports the context management " "protocol to unconditionally consume :exc:`socket.error` exceptions and to " "close the socket when done. (Contributed by Giampaolo Rodolà; :issue:`9794`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1632 +#: ../../whatsnew/3.2.rst:1633 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.2.rst:1634 +#: ../../whatsnew/3.2.rst:1635 msgid "" "The :mod:`ssl` module added a number of features to satisfy common " "requirements for secure (encrypted, authenticated) internet connections:" msgstr "" -#: ../../whatsnew/3.2.rst:1637 +#: ../../whatsnew/3.2.rst:1638 msgid "" "A new class, :class:`~ssl.SSLContext`, serves as a container for persistent " "SSL data, such as protocol settings, certificates, private keys, and various " @@ -1754,14 +1755,14 @@ msgid "" "creating an SSL socket from an SSL context." msgstr "" -#: ../../whatsnew/3.2.rst:1642 +#: ../../whatsnew/3.2.rst:1643 msgid "" "A new function, :func:`ssl.match_hostname`, supports server identity " "verification for higher-level protocols by implementing the rules of HTTPS " "(from :rfc:`2818`) which are also suitable for other protocols." msgstr "" -#: ../../whatsnew/3.2.rst:1646 +#: ../../whatsnew/3.2.rst:1647 msgid "" "The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " "argument. The *ciphers* string lists the allowed encryption algorithms " @@ -1769,7 +1770,7 @@ msgid "" "openssl.org/docs/manmaster/man1/ciphers.html#CIPHER-LIST-FORMAT>`__." msgstr "" -#: ../../whatsnew/3.2.rst:1651 +#: ../../whatsnew/3.2.rst:1652 msgid "" "When linked against recent versions of OpenSSL, the :mod:`ssl` module now " "supports the Server Name Indication extension to the TLS protocol, allowing " @@ -1778,20 +1779,20 @@ msgid "" "the *server_hostname* argument to :meth:`ssl.SSLContext.wrap_socket`." msgstr "" -#: ../../whatsnew/3.2.rst:1657 +#: ../../whatsnew/3.2.rst:1658 msgid "" "Various options have been added to the :mod:`ssl` module, such as :data:" "`~ssl.OP_NO_SSLv2` which disables the insecure and obsolete SSLv2 protocol." msgstr "" -#: ../../whatsnew/3.2.rst:1661 +#: ../../whatsnew/3.2.rst:1662 msgid "" "The extension now loads all the OpenSSL ciphers and digest algorithms. If " "some SSL certificates cannot be verified, they are reported as an \"unknown " "algorithm\" error." msgstr "" -#: ../../whatsnew/3.2.rst:1665 +#: ../../whatsnew/3.2.rst:1666 msgid "" "The version of OpenSSL being used is now accessible using the module " "attributes :data:`ssl.OPENSSL_VERSION` (a string), :data:`ssl." @@ -1799,17 +1800,17 @@ msgid "" "(an integer)." msgstr "" -#: ../../whatsnew/3.2.rst:1670 +#: ../../whatsnew/3.2.rst:1671 msgid "" "(Contributed by Antoine Pitrou in :issue:`8850`, :issue:`1589`, :issue:" "`8322`, :issue:`5639`, :issue:`4870`, :issue:`8484`, and :issue:`8321`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1674 +#: ../../whatsnew/3.2.rst:1675 msgid "nntp" msgstr "nntp" -#: ../../whatsnew/3.2.rst:1676 +#: ../../whatsnew/3.2.rst:1677 msgid "" "The :mod:`nntplib` module has a revamped implementation with better bytes " "and text semantics as well as more practical APIs. These improvements break " @@ -1817,24 +1818,24 @@ msgid "" "dysfunctional in itself." msgstr "" -#: ../../whatsnew/3.2.rst:1681 +#: ../../whatsnew/3.2.rst:1682 msgid "" "Support for secure connections through both implicit (using :class:`nntplib." "NNTP_SSL`) and explicit (using :meth:`nntplib.NNTP.starttls`) TLS has also " "been added." msgstr "" -#: ../../whatsnew/3.2.rst:1685 +#: ../../whatsnew/3.2.rst:1686 msgid "" "(Contributed by Antoine Pitrou in :issue:`9360` and Andrew Vant in :issue:" "`1926`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1688 +#: ../../whatsnew/3.2.rst:1689 msgid "certificates" msgstr "certificates" -#: ../../whatsnew/3.2.rst:1690 +#: ../../whatsnew/3.2.rst:1691 msgid "" ":class:`http.client.HTTPSConnection`, :class:`urllib.request.HTTPSHandler` " "and :func:`urllib.request.urlopen` now take optional arguments to allow for " @@ -1842,49 +1843,49 @@ msgid "" "recommended in public uses of HTTPS." msgstr "" -#: ../../whatsnew/3.2.rst:1695 +#: ../../whatsnew/3.2.rst:1696 msgid "(Added by Antoine Pitrou, :issue:`9003`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1698 +#: ../../whatsnew/3.2.rst:1699 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.2.rst:1700 +#: ../../whatsnew/3.2.rst:1701 msgid "" "Support for explicit TLS on standard IMAP4 connections has been added " "through the new :mod:`imaplib.IMAP4.starttls` method." msgstr "" -#: ../../whatsnew/3.2.rst:1703 +#: ../../whatsnew/3.2.rst:1704 msgid "(Contributed by Lorenzo M. Catucci and Antoine Pitrou, :issue:`4471`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1706 +#: ../../whatsnew/3.2.rst:1707 msgid "http.client" msgstr "http.client" -#: ../../whatsnew/3.2.rst:1708 +#: ../../whatsnew/3.2.rst:1709 msgid "" "There were a number of small API improvements in the :mod:`http.client` " "module. The old-style HTTP 0.9 simple responses are no longer supported and " "the *strict* parameter is deprecated in all classes." msgstr "" -#: ../../whatsnew/3.2.rst:1712 +#: ../../whatsnew/3.2.rst:1713 msgid "" "The :class:`~http.client.HTTPConnection` and :class:`~http.client." "HTTPSConnection` classes now have a *source_address* parameter for a (host, " "port) tuple indicating where the HTTP connection is made from." msgstr "" -#: ../../whatsnew/3.2.rst:1717 +#: ../../whatsnew/3.2.rst:1718 msgid "" "Support for certificate checking and HTTPS virtual hosts were added to :" "class:`~http.client.HTTPSConnection`." msgstr "" -#: ../../whatsnew/3.2.rst:1720 +#: ../../whatsnew/3.2.rst:1721 msgid "" "The :meth:`~http.client.HTTPConnection.request` method on connection objects " "allowed an optional *body* argument so that a :term:`file object` could be " @@ -1894,14 +1895,14 @@ msgid "" "flexible than before." msgstr "" -#: ../../whatsnew/3.2.rst:1727 +#: ../../whatsnew/3.2.rst:1728 msgid "" "To establish an HTTPS connection through a proxy server, there is a new :" "meth:`~http.client.HTTPConnection.set_tunnel` method that sets the host and " "port for HTTP Connect tunneling." msgstr "" -#: ../../whatsnew/3.2.rst:1731 +#: ../../whatsnew/3.2.rst:1732 msgid "" "To match the behavior of :mod:`http.server`, the HTTP client library now " "also encodes headers with ISO-8859-1 (Latin-1) encoding. It was already " @@ -1910,11 +1911,11 @@ msgid "" "`10980`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1737 +#: ../../whatsnew/3.2.rst:1738 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.2.rst:1739 +#: ../../whatsnew/3.2.rst:1740 msgid "" "The unittest module has a number of improvements supporting test discovery " "for packages, easier experimentation at the interactive prompt, new testcase " @@ -1922,7 +1923,7 @@ msgid "" "names." msgstr "" -#: ../../whatsnew/3.2.rst:1744 +#: ../../whatsnew/3.2.rst:1745 msgid "" "The command-line call ``python -m unittest`` can now accept file paths " "instead of module names for running specific tests (:issue:`10620`). The " @@ -1932,29 +1933,29 @@ msgid "" "and a directory to start discovery with ``-s``:" msgstr "" -#: ../../whatsnew/3.2.rst:1755 ../../whatsnew/3.2.rst:1764 -#: ../../whatsnew/3.2.rst:1920 +#: ../../whatsnew/3.2.rst:1756 ../../whatsnew/3.2.rst:1765 +#: ../../whatsnew/3.2.rst:1921 msgid "(Contributed by Michael Foord.)" msgstr "" -#: ../../whatsnew/3.2.rst:1757 +#: ../../whatsnew/3.2.rst:1758 msgid "" "Experimentation at the interactive prompt is now easier because the :class:" "`unittest.case.TestCase` class can now be instantiated without arguments:" msgstr "" -#: ../../whatsnew/3.2.rst:1766 +#: ../../whatsnew/3.2.rst:1767 msgid "" "The :mod:`unittest` module has two new methods, :meth:`~unittest.TestCase." "assertWarns` and :meth:`~unittest.TestCase.assertWarnsRegex` to verify that " "a given warning type is triggered by the code under test::" msgstr "" -#: ../../whatsnew/3.2.rst:1774 +#: ../../whatsnew/3.2.rst:1775 msgid "(Contributed by Antoine Pitrou, :issue:`9754`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1776 +#: ../../whatsnew/3.2.rst:1777 msgid "" "Another new method, :meth:`~unittest.TestCase.assertCountEqual` is used to " "compare two iterables to determine if their element counts are equal " @@ -1962,7 +1963,7 @@ msgid "" "regardless of order)::" msgstr "" -#: ../../whatsnew/3.2.rst:1786 +#: ../../whatsnew/3.2.rst:1787 msgid "" "A principal feature of the unittest module is an effort to produce " "meaningful diagnostics when a test fails. When possible, the failure is " @@ -1972,13 +1973,13 @@ msgid "" "that sets maximum length of diffs displayed." msgstr "" -#: ../../whatsnew/3.2.rst:1793 +#: ../../whatsnew/3.2.rst:1794 msgid "" "In addition, the method names in the module have undergone a number of clean-" "ups." msgstr "" -#: ../../whatsnew/3.2.rst:1795 +#: ../../whatsnew/3.2.rst:1796 msgid "" "For example, :meth:`~unittest.TestCase.assertRegex` is the new name for :" "meth:`~unittest.TestCase.assertRegexpMatches` which was misnamed because the " @@ -1989,76 +1990,76 @@ msgid "" "has unambiguous camel-casing." msgstr "" -#: ../../whatsnew/3.2.rst:1803 +#: ../../whatsnew/3.2.rst:1804 msgid "(Contributed by Raymond Hettinger and implemented by Ezio Melotti.)" msgstr "" -#: ../../whatsnew/3.2.rst:1805 +#: ../../whatsnew/3.2.rst:1806 msgid "" "To improve consistency, some long-standing method aliases are being " "deprecated in favor of the preferred names:" msgstr "" -#: ../../whatsnew/3.2.rst:1809 +#: ../../whatsnew/3.2.rst:1810 msgid "Old Name" msgstr "" -#: ../../whatsnew/3.2.rst:1809 +#: ../../whatsnew/3.2.rst:1810 msgid "Preferred Name" msgstr "" -#: ../../whatsnew/3.2.rst:1811 +#: ../../whatsnew/3.2.rst:1812 msgid ":meth:`assert_`" msgstr ":meth:`assert_`" -#: ../../whatsnew/3.2.rst:1811 +#: ../../whatsnew/3.2.rst:1812 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.2.rst:1812 +#: ../../whatsnew/3.2.rst:1813 msgid ":meth:`assertEquals`" msgstr ":meth:`assertEquals`" -#: ../../whatsnew/3.2.rst:1812 +#: ../../whatsnew/3.2.rst:1813 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.2.rst:1813 +#: ../../whatsnew/3.2.rst:1814 msgid ":meth:`assertNotEquals`" msgstr ":meth:`assertNotEquals`" -#: ../../whatsnew/3.2.rst:1813 +#: ../../whatsnew/3.2.rst:1814 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.2.rst:1814 +#: ../../whatsnew/3.2.rst:1815 msgid ":meth:`assertAlmostEquals`" msgstr ":meth:`assertAlmostEquals`" -#: ../../whatsnew/3.2.rst:1814 +#: ../../whatsnew/3.2.rst:1815 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.2.rst:1815 +#: ../../whatsnew/3.2.rst:1816 msgid ":meth:`assertNotAlmostEquals`" msgstr ":meth:`assertNotAlmostEquals`" -#: ../../whatsnew/3.2.rst:1815 +#: ../../whatsnew/3.2.rst:1816 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.2.rst:1818 +#: ../../whatsnew/3.2.rst:1819 msgid "" "Likewise, the ``TestCase.fail*`` methods deprecated in Python 3.1 are " "expected to be removed in Python 3.3. Also see the :ref:`deprecated-" "aliases` section in the :mod:`unittest` documentation." msgstr "" -#: ../../whatsnew/3.2.rst:1822 +#: ../../whatsnew/3.2.rst:1823 msgid "(Contributed by Ezio Melotti; :issue:`9424`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1824 +#: ../../whatsnew/3.2.rst:1825 msgid "" "The :meth:`~unittest.TestCase.assertDictContainsSubset` method was " "deprecated because it was misimplemented with the arguments in the wrong " @@ -2066,11 +2067,11 @@ msgid "" "``TestCase().assertDictContainsSubset({'a':1, 'b':2}, {'a':1})`` would fail." msgstr "" -#: ../../whatsnew/3.2.rst:1832 +#: ../../whatsnew/3.2.rst:1833 msgid "random" msgstr "random" -#: ../../whatsnew/3.2.rst:1834 +#: ../../whatsnew/3.2.rst:1835 msgid "" "The integer methods in the :mod:`random` module now do a better job of " "producing uniform distributions. Previously, they computed selections with " @@ -2082,15 +2083,15 @@ msgid "" "func:`~random.sample`." msgstr "" -#: ../../whatsnew/3.2.rst:1843 +#: ../../whatsnew/3.2.rst:1844 msgid "(Contributed by Raymond Hettinger; :issue:`9025`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1846 +#: ../../whatsnew/3.2.rst:1847 msgid "poplib" msgstr "poplib" -#: ../../whatsnew/3.2.rst:1848 +#: ../../whatsnew/3.2.rst:1849 msgid "" ":class:`~poplib.POP3_SSL` class now accepts a *context* parameter, which is " "a :class:`ssl.SSLContext` object allowing bundling SSL configuration " @@ -2098,15 +2099,15 @@ msgid "" "lived) structure." msgstr "" -#: ../../whatsnew/3.2.rst:1853 +#: ../../whatsnew/3.2.rst:1854 msgid "(Contributed by Giampaolo Rodolà; :issue:`8807`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1856 +#: ../../whatsnew/3.2.rst:1857 msgid "asyncore" msgstr "asyncore" -#: ../../whatsnew/3.2.rst:1858 +#: ../../whatsnew/3.2.rst:1859 msgid "" ":class:`asyncore.dispatcher` now provides a :meth:`~asyncore.dispatcher." "handle_accepted()` method returning a `(sock, addr)` pair which is called " @@ -2116,41 +2117,41 @@ msgid "" "dispatcher.accept()` directly." msgstr "" -#: ../../whatsnew/3.2.rst:1865 +#: ../../whatsnew/3.2.rst:1866 msgid "(Contributed by Giampaolo Rodolà; :issue:`6706`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1868 +#: ../../whatsnew/3.2.rst:1869 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.2.rst:1870 +#: ../../whatsnew/3.2.rst:1871 msgid "" "The :mod:`tempfile` module has a new context manager, :class:`~tempfile." "TemporaryDirectory` which provides easy deterministic cleanup of temporary " "directories::" msgstr "" -#: ../../whatsnew/3.2.rst:1877 +#: ../../whatsnew/3.2.rst:1878 msgid "(Contributed by Neil Schemenauer and Nick Coghlan; :issue:`5178`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1880 +#: ../../whatsnew/3.2.rst:1881 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.2.rst:1882 +#: ../../whatsnew/3.2.rst:1883 msgid "" "The :mod:`inspect` module has a new function :func:`~inspect." "getgeneratorstate` to easily identify the current state of a generator-" "iterator::" msgstr "" -#: ../../whatsnew/3.2.rst:1900 +#: ../../whatsnew/3.2.rst:1901 msgid "(Contributed by Rodolpho Eckhardt and Nick Coghlan, :issue:`10220`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1902 +#: ../../whatsnew/3.2.rst:1903 msgid "" "To support lookups without the possibility of activating a dynamic " "attribute, the :mod:`inspect` module has a new function, :func:`~inspect." @@ -2158,26 +2159,26 @@ msgid "" "guaranteed not to change state while it is searching::" msgstr "" -#: ../../whatsnew/3.2.rst:1923 +#: ../../whatsnew/3.2.rst:1924 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.2.rst:1925 +#: ../../whatsnew/3.2.rst:1926 msgid "" "The :mod:`pydoc` module now provides a much-improved web server interface, " "as well as a new command-line option ``-b`` to automatically open a browser " "window to display that server:" msgstr "" -#: ../../whatsnew/3.2.rst:1933 +#: ../../whatsnew/3.2.rst:1934 msgid "(Contributed by Ron Adam; :issue:`2001`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1936 +#: ../../whatsnew/3.2.rst:1937 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.2.rst:1938 +#: ../../whatsnew/3.2.rst:1939 msgid "" "The :mod:`dis` module gained two new functions for inspecting code, :func:" "`~dis.code_info` and :func:`~dis.show_code`. Both provide detailed code " @@ -2185,197 +2186,197 @@ msgid "" "code object. The former returns a string and the latter prints it::" msgstr "" -#: ../../whatsnew/3.2.rst:1965 +#: ../../whatsnew/3.2.rst:1966 msgid "" "In addition, the :func:`~dis.dis` function now accepts string arguments so " "that the common idiom ``dis(compile(s, '', 'eval'))`` can be shortened to " "``dis(s)``::" msgstr "" -#: ../../whatsnew/3.2.rst:1987 +#: ../../whatsnew/3.2.rst:1988 msgid "" "Taken together, these improvements make it easier to explore how CPython is " "implemented and to see for yourself what the language syntax does under-the-" "hood." msgstr "" -#: ../../whatsnew/3.2.rst:1991 +#: ../../whatsnew/3.2.rst:1992 msgid "(Contributed by Nick Coghlan in :issue:`9147`.)" msgstr "" -#: ../../whatsnew/3.2.rst:1994 +#: ../../whatsnew/3.2.rst:1995 msgid "dbm" msgstr "dbm" -#: ../../whatsnew/3.2.rst:1996 +#: ../../whatsnew/3.2.rst:1997 msgid "" "All database modules now support the :meth:`get` and :meth:`setdefault` " "methods." msgstr "" -#: ../../whatsnew/3.2.rst:1998 +#: ../../whatsnew/3.2.rst:1999 msgid "(Suggested by Ray Allen in :issue:`9523`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2001 +#: ../../whatsnew/3.2.rst:2002 msgid "ctypes" msgstr "ctypes" -#: ../../whatsnew/3.2.rst:2003 +#: ../../whatsnew/3.2.rst:2004 msgid "" "A new type, :class:`ctypes.c_ssize_t` represents the C :c:type:`ssize_t` " "datatype." msgstr "" -#: ../../whatsnew/3.2.rst:2006 +#: ../../whatsnew/3.2.rst:2007 msgid "site" msgstr "site" -#: ../../whatsnew/3.2.rst:2008 +#: ../../whatsnew/3.2.rst:2009 msgid "" "The :mod:`site` module has three new functions useful for reporting on the " "details of a given Python installation." msgstr "" -#: ../../whatsnew/3.2.rst:2011 +#: ../../whatsnew/3.2.rst:2012 msgid "" ":func:`~site.getsitepackages` lists all global site-packages directories." msgstr "" -#: ../../whatsnew/3.2.rst:2013 +#: ../../whatsnew/3.2.rst:2014 msgid "" ":func:`~site.getuserbase` reports on the user's base directory where data " "can be stored." msgstr "" -#: ../../whatsnew/3.2.rst:2016 +#: ../../whatsnew/3.2.rst:2017 msgid "" ":func:`~site.getusersitepackages` reveals the user-specific site-packages " "directory path." msgstr "" -#: ../../whatsnew/3.2.rst:2031 +#: ../../whatsnew/3.2.rst:2032 msgid "" "Conveniently, some of site's functionality is accessible directly from the " "command-line:" msgstr "" -#: ../../whatsnew/3.2.rst:2041 +#: ../../whatsnew/3.2.rst:2042 msgid "(Contributed by Tarek Ziadé in :issue:`6693`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2044 +#: ../../whatsnew/3.2.rst:2045 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.2.rst:2046 +#: ../../whatsnew/3.2.rst:2047 msgid "" "The new :mod:`sysconfig` module makes it straightforward to discover " "installation paths and configuration variables that vary across platforms " "and installations." msgstr "" -#: ../../whatsnew/3.2.rst:2050 +#: ../../whatsnew/3.2.rst:2051 msgid "" "The module offers access simple access functions for platform and version " "information:" msgstr "" -#: ../../whatsnew/3.2.rst:2053 +#: ../../whatsnew/3.2.rst:2054 msgid "" ":func:`~sysconfig.get_platform` returning values like *linux-i586* or " "*macosx-10.6-ppc*." msgstr "" -#: ../../whatsnew/3.2.rst:2055 +#: ../../whatsnew/3.2.rst:2056 msgid "" ":func:`~sysconfig.get_python_version` returns a Python version string such " "as \"3.2\"." msgstr "" -#: ../../whatsnew/3.2.rst:2058 +#: ../../whatsnew/3.2.rst:2059 msgid "" "It also provides access to the paths and variables corresponding to one of " "seven named schemes used by :mod:`distutils`. Those include *posix_prefix*, " "*posix_home*, *posix_user*, *nt*, *nt_user*, *os2*, *os2_home*:" msgstr "" -#: ../../whatsnew/3.2.rst:2062 +#: ../../whatsnew/3.2.rst:2063 msgid "" ":func:`~sysconfig.get_paths` makes a dictionary containing installation " "paths for the current installation scheme." msgstr "" -#: ../../whatsnew/3.2.rst:2064 +#: ../../whatsnew/3.2.rst:2065 msgid "" ":func:`~sysconfig.get_config_vars` returns a dictionary of platform specific " "variables." msgstr "" -#: ../../whatsnew/3.2.rst:2067 +#: ../../whatsnew/3.2.rst:2068 msgid "There is also a convenient command-line interface:" msgstr "" -#: ../../whatsnew/3.2.rst:2106 +#: ../../whatsnew/3.2.rst:2107 msgid "(Moved out of Distutils by Tarek Ziadé.)" msgstr "" -#: ../../whatsnew/3.2.rst:2109 +#: ../../whatsnew/3.2.rst:2110 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.2.rst:2111 +#: ../../whatsnew/3.2.rst:2112 msgid "" "The :mod:`pdb` debugger module gained a number of usability improvements:" msgstr "" -#: ../../whatsnew/3.2.rst:2113 +#: ../../whatsnew/3.2.rst:2114 msgid "" ":file:`pdb.py` now has a ``-c`` option that executes commands as given in a :" "file:`.pdbrc` script file." msgstr "" -#: ../../whatsnew/3.2.rst:2115 +#: ../../whatsnew/3.2.rst:2116 msgid "" "A :file:`.pdbrc` script file can contain ``continue`` and ``next`` commands " "that continue debugging." msgstr "" -#: ../../whatsnew/3.2.rst:2117 +#: ../../whatsnew/3.2.rst:2118 msgid "The :class:`Pdb` class constructor now accepts a *nosigint* argument." msgstr "" -#: ../../whatsnew/3.2.rst:2118 +#: ../../whatsnew/3.2.rst:2119 msgid "" "New commands: ``l(list)``, ``ll(long list)`` and ``source`` for listing " "source code." msgstr "" -#: ../../whatsnew/3.2.rst:2120 +#: ../../whatsnew/3.2.rst:2121 msgid "" "New commands: ``display`` and ``undisplay`` for showing or hiding the value " "of an expression if it has changed." msgstr "" -#: ../../whatsnew/3.2.rst:2122 +#: ../../whatsnew/3.2.rst:2123 msgid "" "New command: ``interact`` for starting an interactive interpreter containing " "the global and local names found in the current scope." msgstr "" -#: ../../whatsnew/3.2.rst:2124 +#: ../../whatsnew/3.2.rst:2125 msgid "Breakpoints can be cleared by breakpoint number." msgstr "" -#: ../../whatsnew/3.2.rst:2126 +#: ../../whatsnew/3.2.rst:2127 msgid "(Contributed by Georg Brandl, Antonio Cuni and Ilya Sandler.)" msgstr "" -#: ../../whatsnew/3.2.rst:2129 +#: ../../whatsnew/3.2.rst:2130 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.2.rst:2131 +#: ../../whatsnew/3.2.rst:2132 msgid "" "The :mod:`configparser` module was modified to improve usability and " "predictability of the default parser and its supported INI syntax. The old :" @@ -2385,63 +2386,63 @@ msgid "" "option duplicates are not allowed in a single configuration source." msgstr "" -#: ../../whatsnew/3.2.rst:2138 +#: ../../whatsnew/3.2.rst:2139 msgid "Config parsers gained a new API based on the mapping protocol::" msgstr "" -#: ../../whatsnew/3.2.rst:2166 +#: ../../whatsnew/3.2.rst:2167 msgid "" "The new API is implemented on top of the classical API, so custom parser " "subclasses should be able to use it without modifications." msgstr "" -#: ../../whatsnew/3.2.rst:2169 +#: ../../whatsnew/3.2.rst:2170 msgid "" "The INI file structure accepted by config parsers can now be customized. " "Users can specify alternative option/value delimiters and comment prefixes, " "change the name of the *DEFAULT* section or switch the interpolation syntax." msgstr "" -#: ../../whatsnew/3.2.rst:2173 +#: ../../whatsnew/3.2.rst:2174 msgid "" "There is support for pluggable interpolation including an additional " "interpolation handler :class:`~configparser.ExtendedInterpolation`::" msgstr "" -#: ../../whatsnew/3.2.rst:2206 +#: ../../whatsnew/3.2.rst:2207 msgid "" "A number of smaller features were also introduced, like support for " "specifying encoding in read operations, specifying fallback values for get-" "functions, or reading directly from dictionaries and strings." msgstr "" -#: ../../whatsnew/3.2.rst:2210 +#: ../../whatsnew/3.2.rst:2211 msgid "(All changes contributed by Łukasz Langa.)" msgstr "" -#: ../../whatsnew/3.2.rst:2215 +#: ../../whatsnew/3.2.rst:2216 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.2.rst:2217 +#: ../../whatsnew/3.2.rst:2218 msgid "" "A number of usability improvements were made for the :mod:`urllib.parse` " "module." msgstr "" -#: ../../whatsnew/3.2.rst:2219 +#: ../../whatsnew/3.2.rst:2220 msgid "" "The :func:`~urllib.parse.urlparse` function now supports `IPv6 `_ addresses as described in :rfc:`2732`:" msgstr "" -#: ../../whatsnew/3.2.rst:2231 +#: ../../whatsnew/3.2.rst:2232 msgid "" "The :func:`~urllib.parse.urldefrag` function now returns a :term:`named " "tuple`::" msgstr "" -#: ../../whatsnew/3.2.rst:2241 +#: ../../whatsnew/3.2.rst:2242 msgid "" "And, the :func:`~urllib.parse.urlencode` function is now much more flexible, " "accepting either a string or bytes type for the *query* argument. If it is " @@ -2449,7 +2450,7 @@ msgid "" "func:`~urllib.parse.quote_plus` for encoding::" msgstr "" -#: ../../whatsnew/3.2.rst:2252 +#: ../../whatsnew/3.2.rst:2253 msgid "" "As detailed in :ref:`parsing-ascii-encoded-bytes`, all the :mod:`urllib." "parse` functions now accept ASCII-encoded byte strings as input, so long as " @@ -2458,17 +2459,17 @@ msgid "" "strings:" msgstr "" -#: ../../whatsnew/3.2.rst:2261 +#: ../../whatsnew/3.2.rst:2262 msgid "" "(Work by Nick Coghlan, Dan Mahn, and Senthil Kumaran in :issue:`2987`, :" "issue:`5468`, and :issue:`9873`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2265 +#: ../../whatsnew/3.2.rst:2266 msgid "mailbox" msgstr "mailbox" -#: ../../whatsnew/3.2.rst:2267 +#: ../../whatsnew/3.2.rst:2268 msgid "" "Thanks to a concerted effort by R. David Murray, the :mod:`mailbox` module " "has been fixed for Python 3.2. The challenge was that mailbox had been " @@ -2477,27 +2478,27 @@ msgid "" "different encodings." msgstr "" -#: ../../whatsnew/3.2.rst:2272 +#: ../../whatsnew/3.2.rst:2273 msgid "" "The solution harnessed the :mod:`email` package's binary support for parsing " "arbitrary email messages. In addition, the solution required a number of " "API changes." msgstr "" -#: ../../whatsnew/3.2.rst:2276 +#: ../../whatsnew/3.2.rst:2277 msgid "" "As expected, the :meth:`~mailbox.Mailbox.add` method for :class:`mailbox." "Mailbox` objects now accepts binary input." msgstr "" -#: ../../whatsnew/3.2.rst:2279 +#: ../../whatsnew/3.2.rst:2280 msgid "" ":class:`~io.StringIO` and text file input are deprecated. Also, string " "input will fail early if non-ASCII characters are used. Previously it would " "fail when the email was processed in a later step." msgstr "" -#: ../../whatsnew/3.2.rst:2283 +#: ../../whatsnew/3.2.rst:2284 msgid "" "There is also support for binary output. The :meth:`~mailbox.Mailbox." "get_file` method now returns a file in the binary mode (where it used to " @@ -2506,7 +2507,7 @@ msgid "" "message corresponding to a given *key*." msgstr "" -#: ../../whatsnew/3.2.rst:2289 +#: ../../whatsnew/3.2.rst:2290 msgid "" "It is still possible to get non-binary output using the old API's :meth:" "`~mailbox.Mailbox.get_string` method, but that approach is not very useful. " @@ -2514,17 +2515,17 @@ msgid "" "object or to load them from binary input." msgstr "" -#: ../../whatsnew/3.2.rst:2294 +#: ../../whatsnew/3.2.rst:2295 msgid "" "(Contributed by R. David Murray, with efforts from Steffen Daode Nurpmeso " "and an initial patch by Victor Stinner in :issue:`9124`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2298 +#: ../../whatsnew/3.2.rst:2299 msgid "turtledemo" msgstr "turtledemo" -#: ../../whatsnew/3.2.rst:2300 +#: ../../whatsnew/3.2.rst:2301 msgid "" "The demonstration code for the :mod:`turtle` module was moved from the " "*Demo* directory to main library. It includes over a dozen sample scripts " @@ -2532,16 +2533,16 @@ msgid "" "from the command-line:" msgstr "" -#: ../../whatsnew/3.2.rst:2309 +#: ../../whatsnew/3.2.rst:2310 msgid "" "(Moved from the Demo directory by Alexander Belopolsky in :issue:`10199`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2312 +#: ../../whatsnew/3.2.rst:2313 msgid "Multi-threading" msgstr "" -#: ../../whatsnew/3.2.rst:2314 +#: ../../whatsnew/3.2.rst:2315 msgid "" "The mechanism for serializing execution of concurrently running Python " "threads (generally known as the :term:`GIL` or Global Interpreter Lock) has " @@ -2553,7 +2554,7 @@ msgid "" "setswitchinterval()`. It currently defaults to 5 milliseconds." msgstr "" -#: ../../whatsnew/3.2.rst:2323 +#: ../../whatsnew/3.2.rst:2324 msgid "" "Additional details about the implementation can be read from a `python-dev " "mailing-list message `_ used in :" "meth:`list.sort` and :func:`sorted` now runs faster and uses less memory " @@ -2637,35 +2638,35 @@ msgid "" "saves time lost to delegating comparisons." msgstr "" -#: ../../whatsnew/3.2.rst:2378 +#: ../../whatsnew/3.2.rst:2379 msgid "(Patch by Daniel Stutzbach in :issue:`9915`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2380 +#: ../../whatsnew/3.2.rst:2381 msgid "" "JSON decoding performance is improved and memory consumption is reduced " "whenever the same string is repeated for multiple keys. Also, JSON encoding " "now uses the C speedups when the ``sort_keys`` argument is true." msgstr "" -#: ../../whatsnew/3.2.rst:2384 +#: ../../whatsnew/3.2.rst:2385 msgid "" "(Contributed by Antoine Pitrou in :issue:`7451` and by Raymond Hettinger and " "Antoine Pitrou in :issue:`10314`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2387 +#: ../../whatsnew/3.2.rst:2388 msgid "" "Recursive locks (created with the :func:`threading.RLock` API) now benefit " "from a C implementation which makes them as fast as regular locks, and " "between 10x and 15x faster than their previous pure Python implementation." msgstr "" -#: ../../whatsnew/3.2.rst:2391 +#: ../../whatsnew/3.2.rst:2392 msgid "(Contributed by Antoine Pitrou; :issue:`3001`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2393 +#: ../../whatsnew/3.2.rst:2394 msgid "" "The fast-search algorithm in stringlib is now used by the :meth:`split`, :" "meth:`rsplit`, :meth:`splitlines` and :meth:`replace` methods on :class:" @@ -2674,21 +2675,21 @@ msgid "" "meth:`rpartition`." msgstr "" -#: ../../whatsnew/3.2.rst:2399 +#: ../../whatsnew/3.2.rst:2400 msgid "(Patch by Florent Xicluna in :issue:`7622` and :issue:`7462`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2402 +#: ../../whatsnew/3.2.rst:2403 msgid "" "Integer to string conversions now work two \"digits\" at a time, reducing " "the number of division and modulo operations." msgstr "" -#: ../../whatsnew/3.2.rst:2405 +#: ../../whatsnew/3.2.rst:2406 msgid "(:issue:`6713` by Gawain Bolton, Mark Dickinson, and Victor Stinner.)" msgstr "" -#: ../../whatsnew/3.2.rst:2407 +#: ../../whatsnew/3.2.rst:2408 msgid "" "There were several other minor optimizations. Set differencing now runs " "faster when one operand is much larger than the other (patch by Andress " @@ -2700,11 +2701,11 @@ msgid "" "line arguments a bit faster (:issue:`7113` by Łukasz Langa)." msgstr "" -#: ../../whatsnew/3.2.rst:2418 +#: ../../whatsnew/3.2.rst:2419 msgid "Unicode" msgstr "" -#: ../../whatsnew/3.2.rst:2420 +#: ../../whatsnew/3.2.rst:2421 msgid "" "Python has been updated to `Unicode 6.0.0 `_. The update to the standard adds over 2,000 new characters " @@ -2712,7 +2713,7 @@ msgid "" "important for mobile phones." msgstr "" -#: ../../whatsnew/3.2.rst:2425 +#: ../../whatsnew/3.2.rst:2426 msgid "" "In addition, the updated standard has altered the character properties for " "two Kannada characters (U+0CF1, U+0CF2) and one New Tai Lue numeric " @@ -2722,15 +2723,15 @@ msgid "" "#Database_Changes>`_." msgstr "" -#: ../../whatsnew/3.2.rst:2433 +#: ../../whatsnew/3.2.rst:2434 msgid "Codecs" msgstr "" -#: ../../whatsnew/3.2.rst:2435 +#: ../../whatsnew/3.2.rst:2436 msgid "Support was added for *cp720* Arabic DOS encoding (:issue:`1616979`)." msgstr "" -#: ../../whatsnew/3.2.rst:2437 +#: ../../whatsnew/3.2.rst:2438 msgid "" "MBCS encoding no longer ignores the error handler argument. In the default " "strict mode, it raises an :exc:`UnicodeDecodeError` when it encounters an " @@ -2738,40 +2739,40 @@ msgid "" "unencodable character." msgstr "" -#: ../../whatsnew/3.2.rst:2442 +#: ../../whatsnew/3.2.rst:2443 msgid "" "The MBCS codec supports ``'strict'`` and ``'ignore'`` error handlers for " "decoding, and ``'strict'`` and ``'replace'`` for encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2445 +#: ../../whatsnew/3.2.rst:2446 msgid "" "To emulate Python3.1 MBCS encoding, select the ``'ignore'`` handler for " "decoding and the ``'replace'`` handler for encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2448 +#: ../../whatsnew/3.2.rst:2449 msgid "" "On Mac OS X, Python decodes command line arguments with ``'utf-8'`` rather " "than the locale encoding." msgstr "" -#: ../../whatsnew/3.2.rst:2451 +#: ../../whatsnew/3.2.rst:2452 msgid "" "By default, :mod:`tarfile` uses ``'utf-8'`` encoding on Windows (instead of " "``'mbcs'``) and the ``'surrogateescape'`` error handler on all operating " "systems." msgstr "" -#: ../../whatsnew/3.2.rst:2457 +#: ../../whatsnew/3.2.rst:2458 msgid "Documentation" msgstr "文件" -#: ../../whatsnew/3.2.rst:2459 +#: ../../whatsnew/3.2.rst:2460 msgid "The documentation continues to be improved." msgstr "" -#: ../../whatsnew/3.2.rst:2461 +#: ../../whatsnew/3.2.rst:2462 msgid "" "A table of quick links has been added to the top of lengthy sections such " "as :ref:`built-in-funcs`. In the case of :mod:`itertools`, the links are " @@ -2779,7 +2780,7 @@ msgid "" "and memory jog without having to read all of the docs." msgstr "" -#: ../../whatsnew/3.2.rst:2466 +#: ../../whatsnew/3.2.rst:2467 msgid "" "In some cases, the pure Python source code can be a helpful adjunct to the " "documentation, so now many modules now feature quick links to the latest " @@ -2787,80 +2788,80 @@ msgid "" "documentation has a quick link at the top labeled:" msgstr "" -#: ../../whatsnew/3.2.rst:2471 +#: ../../whatsnew/3.2.rst:2472 msgid "**Source code** :source:`Lib/functools.py`." msgstr "" -#: ../../whatsnew/3.2.rst:2473 +#: ../../whatsnew/3.2.rst:2474 msgid "" "(Contributed by Raymond Hettinger; see `rationale `_.)" msgstr "" -#: ../../whatsnew/3.2.rst:2476 +#: ../../whatsnew/3.2.rst:2477 msgid "" "The docs now contain more examples and recipes. In particular, :mod:`re` " "module has an extensive section, :ref:`re-examples`. Likewise, the :mod:" "`itertools` module continues to be updated with new :ref:`itertools-recipes`." msgstr "" -#: ../../whatsnew/3.2.rst:2481 +#: ../../whatsnew/3.2.rst:2482 msgid "" "The :mod:`datetime` module now has an auxiliary implementation in pure " "Python. No functionality was changed. This just provides an easier-to-read " "alternate implementation." msgstr "" -#: ../../whatsnew/3.2.rst:2485 +#: ../../whatsnew/3.2.rst:2486 msgid "(Contributed by Alexander Belopolsky in :issue:`9528`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2487 +#: ../../whatsnew/3.2.rst:2488 msgid "" "The unmaintained :file:`Demo` directory has been removed. Some demos were " "integrated into the documentation, some were moved to the :file:`Tools/demo` " "directory, and others were removed altogether." msgstr "" -#: ../../whatsnew/3.2.rst:2491 +#: ../../whatsnew/3.2.rst:2492 msgid "(Contributed by Georg Brandl in :issue:`7962`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2495 +#: ../../whatsnew/3.2.rst:2496 msgid "IDLE" msgstr "IDLE" -#: ../../whatsnew/3.2.rst:2497 +#: ../../whatsnew/3.2.rst:2498 msgid "" "The format menu now has an option to clean source files by stripping " "trailing whitespace." msgstr "" -#: ../../whatsnew/3.2.rst:2500 +#: ../../whatsnew/3.2.rst:2501 msgid "(Contributed by Raymond Hettinger; :issue:`5150`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2502 +#: ../../whatsnew/3.2.rst:2503 msgid "IDLE on Mac OS X now works with both Carbon AquaTk and Cocoa AquaTk." msgstr "" -#: ../../whatsnew/3.2.rst:2504 +#: ../../whatsnew/3.2.rst:2505 msgid "" "(Contributed by Kevin Walzer, Ned Deily, and Ronald Oussoren; :issue:`6075`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2507 +#: ../../whatsnew/3.2.rst:2508 msgid "Code Repository" msgstr "" -#: ../../whatsnew/3.2.rst:2509 +#: ../../whatsnew/3.2.rst:2510 msgid "" "In addition to the existing Subversion code repository at http://svn.python." "org there is now a `Mercurial `_ repository " "at https://hg.python.org/\\ ." msgstr "" -#: ../../whatsnew/3.2.rst:2513 +#: ../../whatsnew/3.2.rst:2514 msgid "" "After the 3.2 release, there are plans to switch to Mercurial as the primary " "repository. This distributed version control system should make it easier " @@ -2868,28 +2869,28 @@ msgid "" "pep:`385` for details." msgstr "" -#: ../../whatsnew/3.2.rst:2518 +#: ../../whatsnew/3.2.rst:2519 msgid "" "To learn to use the new version control system, see the `Quick Start " "`_ or the `Guide to Mercurial " "Workflows `_." msgstr "" -#: ../../whatsnew/3.2.rst:2524 +#: ../../whatsnew/3.2.rst:2525 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.2.rst:2526 +#: ../../whatsnew/3.2.rst:2527 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/3.2.rst:2528 +#: ../../whatsnew/3.2.rst:2529 msgid "" "The *idle*, *pydoc* and *2to3* scripts are now installed with a version-" "specific suffix on ``make altinstall`` (:issue:`10679`)." msgstr "" -#: ../../whatsnew/3.2.rst:2531 +#: ../../whatsnew/3.2.rst:2532 msgid "" "The C functions that access the Unicode Database now accept and return " "characters from the full Unicode range, even on narrow unicode builds " @@ -2899,33 +2900,33 @@ msgid "" "characters as printable." msgstr "" -#: ../../whatsnew/3.2.rst:2538 +#: ../../whatsnew/3.2.rst:2539 msgid "" "(Reported by Bupjoe Lee and fixed by Amaury Forgeot D'Arc; :issue:`5127`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2540 +#: ../../whatsnew/3.2.rst:2541 msgid "" "Computed gotos are now enabled by default on supported compilers (which are " "detected by the configure script). They can still be disabled selectively " "by specifying ``--without-computed-gotos``." msgstr "" -#: ../../whatsnew/3.2.rst:2544 +#: ../../whatsnew/3.2.rst:2545 msgid "(Contributed by Antoine Pitrou; :issue:`9203`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2546 +#: ../../whatsnew/3.2.rst:2547 msgid "" "The option ``--with-wctype-functions`` was removed. The built-in unicode " "database is now used for all functions." msgstr "" -#: ../../whatsnew/3.2.rst:2549 +#: ../../whatsnew/3.2.rst:2550 msgid "(Contributed by Amaury Forgeot D'Arc; :issue:`9210`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2551 +#: ../../whatsnew/3.2.rst:2552 msgid "" "Hash values are now values of a new type, :c:type:`Py_hash_t`, which is " "defined to be the same size as a pointer. Previously they were of type " @@ -2935,34 +2936,34 @@ msgid "" "grow to that size but their performance degraded catastrophically)." msgstr "" -#: ../../whatsnew/3.2.rst:2558 +#: ../../whatsnew/3.2.rst:2559 msgid "" "(Suggested by Raymond Hettinger and implemented by Benjamin Peterson; :issue:" "`9778`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2561 +#: ../../whatsnew/3.2.rst:2562 msgid "" "A new macro :c:macro:`Py_VA_COPY` copies the state of the variable argument " "list. It is equivalent to C99 *va_copy* but available on all Python " "platforms (:issue:`2443`)." msgstr "" -#: ../../whatsnew/3.2.rst:2565 +#: ../../whatsnew/3.2.rst:2566 msgid "" "A new C API function :c:func:`PySys_SetArgvEx` allows an embedded " "interpreter to set :attr:`sys.argv` without also modifying :attr:`sys.path` " "(:issue:`5753`)." msgstr "" -#: ../../whatsnew/3.2.rst:2569 +#: ../../whatsnew/3.2.rst:2570 msgid "" ":c:macro:`PyEval_CallObject` is now only available in macro form. The " "function declaration, which was kept for backwards compatibility reasons, is " "now removed -- the macro was introduced in 1997 (:issue:`8276`)." msgstr "" -#: ../../whatsnew/3.2.rst:2573 +#: ../../whatsnew/3.2.rst:2574 msgid "" "There is a new function :c:func:`PyLong_AsLongLongAndOverflow` which is " "analogous to :c:func:`PyLong_AsLongAndOverflow`. They both serve to convert " @@ -2970,13 +2971,13 @@ msgid "" "of cases where the conversion won't fit (:issue:`7767`)." msgstr "" -#: ../../whatsnew/3.2.rst:2578 +#: ../../whatsnew/3.2.rst:2579 msgid "" "The :c:func:`PyUnicode_CompareWithASCIIString` function now returns *not " "equal* if the Python string is *NUL* terminated." msgstr "" -#: ../../whatsnew/3.2.rst:2581 +#: ../../whatsnew/3.2.rst:2582 msgid "" "There is a new function :c:func:`PyErr_NewExceptionWithDoc` that is like :c:" "func:`PyErr_NewException` but allows a docstring to be specified. This lets " @@ -2984,7 +2985,7 @@ msgid "" "Python counterparts (:issue:`7033`)." msgstr "" -#: ../../whatsnew/3.2.rst:2586 +#: ../../whatsnew/3.2.rst:2587 msgid "" "When compiled with the ``--with-valgrind`` option, the pymalloc allocator " "will be automatically disabled when running under Valgrind. This gives " @@ -2992,19 +2993,19 @@ msgid "" "advantage of pymalloc at other times (:issue:`2422`)." msgstr "" -#: ../../whatsnew/3.2.rst:2591 +#: ../../whatsnew/3.2.rst:2592 msgid "" "Removed the ``O?`` format from the *PyArg_Parse* functions. The format is " "no longer used and it had never been documented (:issue:`8837`)." msgstr "" -#: ../../whatsnew/3.2.rst:2594 +#: ../../whatsnew/3.2.rst:2595 msgid "" "There were a number of other small changes to the C-API. See the :source:" "`Misc/NEWS` file for a complete list." msgstr "" -#: ../../whatsnew/3.2.rst:2597 +#: ../../whatsnew/3.2.rst:2598 msgid "" "Also, there were a number of updates to the Mac OS X build, see :source:`Mac/" "BuildScript/README.txt` for details. For users running a 32/64-bit build, " @@ -3014,17 +3015,17 @@ msgid "" "\\. See https://www.python.org/download/mac/tcltk/ for additional details." msgstr "" -#: ../../whatsnew/3.2.rst:2605 +#: ../../whatsnew/3.2.rst:2606 msgid "Porting to Python 3.2" msgstr "" -#: ../../whatsnew/3.2.rst:2607 +#: ../../whatsnew/3.2.rst:2608 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/3.2.rst:2610 +#: ../../whatsnew/3.2.rst:2611 msgid "" "The :mod:`configparser` module has a number of clean-ups. The major change " "is to replace the old :class:`ConfigParser` class with long-standing " @@ -3032,7 +3033,7 @@ msgid "" "number of smaller incompatibilities:" msgstr "" -#: ../../whatsnew/3.2.rst:2615 +#: ../../whatsnew/3.2.rst:2616 msgid "" "The interpolation syntax is now validated on :meth:`~configparser." "ConfigParser.get` and :meth:`~configparser.ConfigParser.set` operations. In " @@ -3040,14 +3041,14 @@ msgid "" "valid: ``%(name)s`` and ``%%``, the latter being an escaped percent sign." msgstr "" -#: ../../whatsnew/3.2.rst:2621 +#: ../../whatsnew/3.2.rst:2622 msgid "" "The :meth:`~configparser.ConfigParser.set` and :meth:`~configparser." "ConfigParser.add_section` methods now verify that values are actual " "strings. Formerly, unsupported types could be introduced unintentionally." msgstr "" -#: ../../whatsnew/3.2.rst:2626 +#: ../../whatsnew/3.2.rst:2627 msgid "" "Duplicate sections or options from a single source now raise either :exc:" "`~configparser.DuplicateSectionError` or :exc:`~configparser." @@ -3055,57 +3056,57 @@ msgid "" "previous entry." msgstr "" -#: ../../whatsnew/3.2.rst:2631 +#: ../../whatsnew/3.2.rst:2632 msgid "" "Inline comments are now disabled by default so now the **;** character can " "be safely used in values." msgstr "" -#: ../../whatsnew/3.2.rst:2634 +#: ../../whatsnew/3.2.rst:2635 msgid "" "Comments now can be indented. Consequently, for **;** or **#** to appear at " "the start of a line in multiline values, it has to be interpolated. This " "keeps comment prefix characters in values from being mistaken as comments." msgstr "" -#: ../../whatsnew/3.2.rst:2638 +#: ../../whatsnew/3.2.rst:2639 msgid "" "``\"\"`` is now a valid value and is no longer automatically converted to an " "empty string. For empty strings, use ``\"option =\"`` in a line." msgstr "" -#: ../../whatsnew/3.2.rst:2641 +#: ../../whatsnew/3.2.rst:2642 msgid "" "The :mod:`nntplib` module was reworked extensively, meaning that its APIs " "are often incompatible with the 3.1 APIs." msgstr "" -#: ../../whatsnew/3.2.rst:2644 +#: ../../whatsnew/3.2.rst:2645 msgid "" ":class:`bytearray` objects can no longer be used as filenames; instead, they " "should be converted to :class:`bytes`." msgstr "" -#: ../../whatsnew/3.2.rst:2647 +#: ../../whatsnew/3.2.rst:2648 msgid "" "The :meth:`array.tostring` and :meth:`array.fromstring` have been renamed " "to :meth:`array.tobytes` and :meth:`array.frombytes` for clarity. The old " "names have been deprecated. (See :issue:`8990`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2651 +#: ../../whatsnew/3.2.rst:2652 msgid "``PyArg_Parse*()`` functions:" msgstr "" -#: ../../whatsnew/3.2.rst:2653 +#: ../../whatsnew/3.2.rst:2654 msgid "\"t#\" format has been removed: use \"s#\" or \"s*\" instead" msgstr "" -#: ../../whatsnew/3.2.rst:2654 +#: ../../whatsnew/3.2.rst:2655 msgid "\"w\" and \"w#\" formats has been removed: use \"w*\" instead" msgstr "" -#: ../../whatsnew/3.2.rst:2656 +#: ../../whatsnew/3.2.rst:2657 msgid "" "The :c:type:`PyCObject` type, deprecated in 3.1, has been removed. To wrap " "opaque C pointers in Python objects, the :c:type:`PyCapsule` API should be " @@ -3113,13 +3114,13 @@ msgid "" "safety information and a less complicated signature for calling a destructor." msgstr "" -#: ../../whatsnew/3.2.rst:2661 +#: ../../whatsnew/3.2.rst:2662 msgid "" "The :func:`sys.setfilesystemencoding` function was removed because it had a " "flawed design." msgstr "" -#: ../../whatsnew/3.2.rst:2664 +#: ../../whatsnew/3.2.rst:2665 msgid "" "The :func:`random.seed` function and method now salt string seeds with an " "sha512 hash function. To access the previous version of *seed* in order to " @@ -3127,7 +3128,7 @@ msgid "" "seed(s, version=1)``." msgstr "" -#: ../../whatsnew/3.2.rst:2669 +#: ../../whatsnew/3.2.rst:2670 msgid "" "The previously deprecated :func:`string.maketrans` function has been removed " "in favor of the static methods :meth:`bytes.maketrans` and :meth:`bytearray." @@ -3137,11 +3138,11 @@ msgid "" "methods with intermediate translation tables of the appropriate type." msgstr "" -#: ../../whatsnew/3.2.rst:2677 +#: ../../whatsnew/3.2.rst:2678 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2679 +#: ../../whatsnew/3.2.rst:2680 msgid "" "The previously deprecated :func:`contextlib.nested` function has been " "removed in favor of a plain :keyword:`with` statement which can accept " @@ -3150,13 +3151,13 @@ msgid "" "when one of them raises an exception::" msgstr "" -#: ../../whatsnew/3.2.rst:2690 +#: ../../whatsnew/3.2.rst:2691 msgid "" "(Contributed by Georg Brandl and Mattias Brändström; `appspot issue 53094 " "`_.)" msgstr "" -#: ../../whatsnew/3.2.rst:2693 +#: ../../whatsnew/3.2.rst:2694 msgid "" ":func:`struct.pack` now only allows bytes for the ``s`` string pack code. " "Formerly, it would accept text arguments and implicitly encode them to bytes " @@ -3165,32 +3166,32 @@ msgid "" "writing to fixed length segment of a structure." msgstr "" -#: ../../whatsnew/3.2.rst:2699 +#: ../../whatsnew/3.2.rst:2700 msgid "" "Code such as ``struct.pack('<6sHHBBB', 'GIF87a', x, y)`` should be rewritten " "with to use bytes instead of text, ``struct.pack('<6sHHBBB', b'GIF87a', x, " "y)``." msgstr "" -#: ../../whatsnew/3.2.rst:2702 +#: ../../whatsnew/3.2.rst:2703 msgid "" "(Discovered by David Beazley and fixed by Victor Stinner; :issue:`10783`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2704 +#: ../../whatsnew/3.2.rst:2705 msgid "" "The :class:`xml.etree.ElementTree` class now raises an :exc:`xml.etree." "ElementTree.ParseError` when a parse fails. Previously it raised an :exc:" "`xml.parsers.expat.ExpatError`." msgstr "" -#: ../../whatsnew/3.2.rst:2708 +#: ../../whatsnew/3.2.rst:2709 msgid "" "The new, longer :func:`str` value on floats may break doctests which rely on " "the old output format." msgstr "" -#: ../../whatsnew/3.2.rst:2711 +#: ../../whatsnew/3.2.rst:2712 msgid "" "In :class:`subprocess.Popen`, the default value for *close_fds* is now " "``True`` under Unix; under Windows, it is ``True`` if the three standard " @@ -3199,28 +3200,28 @@ msgid "" "race conditions when open file descriptors would leak into the child process." msgstr "" -#: ../../whatsnew/3.2.rst:2718 +#: ../../whatsnew/3.2.rst:2719 msgid "" "Support for legacy HTTP 0.9 has been removed from :mod:`urllib.request` and :" "mod:`http.client`. Such support is still present on the server side (in :" "mod:`http.server`)." msgstr "" -#: ../../whatsnew/3.2.rst:2722 +#: ../../whatsnew/3.2.rst:2723 msgid "(Contributed by Antoine Pitrou, :issue:`10711`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2724 +#: ../../whatsnew/3.2.rst:2725 msgid "" "SSL sockets in timeout mode now raise :exc:`socket.timeout` when a timeout " "occurs, rather than a generic :exc:`~ssl.SSLError`." msgstr "" -#: ../../whatsnew/3.2.rst:2727 +#: ../../whatsnew/3.2.rst:2728 msgid "(Contributed by Antoine Pitrou, :issue:`10272`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2729 +#: ../../whatsnew/3.2.rst:2730 msgid "" "The misleading functions :c:func:`PyEval_AcquireLock()` and :c:func:" "`PyEval_ReleaseLock()` have been officially deprecated. The thread-state " @@ -3228,18 +3229,18 @@ msgid "" "`PyEval_RestoreThread()`) should be used instead." msgstr "" -#: ../../whatsnew/3.2.rst:2734 +#: ../../whatsnew/3.2.rst:2735 msgid "" "Due to security risks, :func:`asyncore.handle_accept` has been deprecated, " "and a new function, :func:`asyncore.handle_accepted`, was added to replace " "it." msgstr "" -#: ../../whatsnew/3.2.rst:2737 +#: ../../whatsnew/3.2.rst:2738 msgid "(Contributed by Giampaolo Rodola in :issue:`6706`.)" msgstr "" -#: ../../whatsnew/3.2.rst:2739 +#: ../../whatsnew/3.2.rst:2740 msgid "" "Due to the new :term:`GIL` implementation, :c:func:`PyEval_InitThreads()` " "cannot be called before :c:func:`Py_Initialize()` anymore." diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index c5e64cc37a..2ceab0290e 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-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-05-30 00:18+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-" @@ -32,23 +32,24 @@ msgstr "Raymond Hettinger" #: ../../whatsnew/3.8.rst:47 msgid "" -"This article explains the new features in Python 3.8, compared to 3.7. For " -"full details, see the :ref:`changelog `." +"This article explains the new features in Python 3.8, compared to 3.7. " +"Python 3.8 was released on October 14, 2019. For full details, see the :ref:" +"`changelog `." msgstr "" -#: ../../whatsnew/3.8.rst:60 +#: ../../whatsnew/3.8.rst:61 msgid "Summary -- Release highlights" msgstr "" -#: ../../whatsnew/3.8.rst:71 +#: ../../whatsnew/3.8.rst:72 msgid "New Features" msgstr "" -#: ../../whatsnew/3.8.rst:74 +#: ../../whatsnew/3.8.rst:75 msgid "Assignment expressions" msgstr "" -#: ../../whatsnew/3.8.rst:76 +#: ../../whatsnew/3.8.rst:77 msgid "" "There is new syntax ``:=`` that assigns values to variables as part of a " "larger expression. It is affectionately known as \"the walrus operator\" due " @@ -56,51 +57,51 @@ msgid "" "org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg>`_." msgstr "" -#: ../../whatsnew/3.8.rst:81 +#: ../../whatsnew/3.8.rst:82 msgid "" "In this example, the assignment expression helps avoid calling :func:`len` " "twice::" msgstr "" -#: ../../whatsnew/3.8.rst:87 +#: ../../whatsnew/3.8.rst:88 msgid "" "A similar benefit arises during regular expression matching where match " "objects are needed twice, once to test whether a match occurred and another " "to extract a subgroup::" msgstr "" -#: ../../whatsnew/3.8.rst:95 +#: ../../whatsnew/3.8.rst:96 msgid "" "The operator is also useful with while-loops that compute a value to test " "loop termination and then need that same value again in the body of the " "loop::" msgstr "" -#: ../../whatsnew/3.8.rst:103 +#: ../../whatsnew/3.8.rst:104 msgid "" "Another motivating use case arises in list comprehensions where a value " "computed in a filtering condition is also needed in the expression body::" msgstr "" -#: ../../whatsnew/3.8.rst:110 +#: ../../whatsnew/3.8.rst:111 msgid "" "Try to limit use of the walrus operator to clean cases that reduce " "complexity and improve readability." msgstr "" -#: ../../whatsnew/3.8.rst:113 +#: ../../whatsnew/3.8.rst:114 msgid "See :pep:`572` for a full description." msgstr "完整敘述請見 :pep:`572`\\ 。" -#: ../../whatsnew/3.8.rst:115 +#: ../../whatsnew/3.8.rst:116 msgid "(Contributed by Emily Morehouse in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:119 +#: ../../whatsnew/3.8.rst:120 msgid "Positional-only parameters" msgstr "" -#: ../../whatsnew/3.8.rst:121 +#: ../../whatsnew/3.8.rst:122 msgid "" "There is a new function parameter syntax ``/`` to indicate that some " "function parameters must be specified positionally and cannot be used as " @@ -109,36 +110,36 @@ msgid "" "python.org/3/howto/clinic.html>`_ tool." msgstr "" -#: ../../whatsnew/3.8.rst:127 +#: ../../whatsnew/3.8.rst:128 msgid "" "In the following example, parameters *a* and *b* are positional-only, while " "*c* or *d* can be positional or keyword, and *e* or *f* are required to be " "keywords::" msgstr "" -#: ../../whatsnew/3.8.rst:134 +#: ../../whatsnew/3.8.rst:135 msgid "The following is a valid call::" msgstr "" -#: ../../whatsnew/3.8.rst:138 +#: ../../whatsnew/3.8.rst:139 msgid "However, these are invalid calls::" msgstr "" -#: ../../whatsnew/3.8.rst:143 +#: ../../whatsnew/3.8.rst:144 msgid "" "One use case for this notation is that it allows pure Python functions to " "fully emulate behaviors of existing C coded functions. For example, the " "built-in :func:`divmod` function does not accept keyword arguments::" msgstr "" -#: ../../whatsnew/3.8.rst:151 +#: ../../whatsnew/3.8.rst:152 msgid "" "Another use case is to preclude keyword arguments when the parameter name is " "not helpful. For example, the builtin :func:`len` function has the " "signature ``len(obj, /)``. This precludes awkward calls such as::" msgstr "" -#: ../../whatsnew/3.8.rst:157 +#: ../../whatsnew/3.8.rst:158 msgid "" "A further benefit of marking a parameter as positional-only is that it " "allows the parameter name to be changed in the future without risk of " @@ -147,32 +148,32 @@ msgid "" "with the following function specification::" msgstr "" -#: ../../whatsnew/3.8.rst:166 +#: ../../whatsnew/3.8.rst:167 msgid "" "Since the parameters to the left of ``/`` are not exposed as possible " "keywords, the parameters names remain available for use in ``**kwargs``::" msgstr "" -#: ../../whatsnew/3.8.rst:175 +#: ../../whatsnew/3.8.rst:176 msgid "" "This greatly simplifies the implementation of functions and methods that " "need to accept arbitrary keyword arguments. For example, here is an excerpt " "from code in the :mod:`collections` module::" msgstr "" -#: ../../whatsnew/3.8.rst:184 +#: ../../whatsnew/3.8.rst:185 msgid "See :pep:`570` for a full description." msgstr "完整敘述請見 :pep:`570`\\ 。" -#: ../../whatsnew/3.8.rst:186 +#: ../../whatsnew/3.8.rst:187 msgid "(Contributed by Pablo Galindo in :issue:`36540`.)" msgstr "" -#: ../../whatsnew/3.8.rst:192 +#: ../../whatsnew/3.8.rst:193 msgid "Parallel filesystem cache for compiled bytecode files" msgstr "" -#: ../../whatsnew/3.8.rst:194 +#: ../../whatsnew/3.8.rst:195 msgid "" "The new :envvar:`PYTHONPYCACHEPREFIX` setting (also available as :option:`-" "X` ``pycache_prefix``) configures the implicit bytecode cache to use a " @@ -180,28 +181,28 @@ msgid "" "subdirectories within each source directory." msgstr "" -#: ../../whatsnew/3.8.rst:200 +#: ../../whatsnew/3.8.rst:201 msgid "" "The location of the cache is reported in :data:`sys.pycache_prefix` (:const:" "`None` indicates the default location in ``__pycache__`` subdirectories)." msgstr "" -#: ../../whatsnew/3.8.rst:204 +#: ../../whatsnew/3.8.rst:205 msgid "(Contributed by Carl Meyer in :issue:`33499`.)" msgstr "" -#: ../../whatsnew/3.8.rst:208 +#: ../../whatsnew/3.8.rst:209 msgid "Debug build uses the same ABI as release build" msgstr "" -#: ../../whatsnew/3.8.rst:210 +#: ../../whatsnew/3.8.rst:211 msgid "" "Python now uses the same ABI whether it's built in release or debug mode. On " "Unix, when Python is built in debug mode, it is now possible to load C " "extensions built in release mode and C extensions built using the stable ABI." msgstr "" -#: ../../whatsnew/3.8.rst:214 +#: ../../whatsnew/3.8.rst:215 msgid "" "Release builds and :ref:`debug builds ` are now ABI compatible: " "defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` " @@ -212,7 +213,7 @@ msgid "" "by Victor Stinner in :issue:`36465`.)" msgstr "" -#: ../../whatsnew/3.8.rst:222 +#: ../../whatsnew/3.8.rst:223 msgid "" "On Unix, C extensions are no longer linked to libpython except on Android " "and Cygwin. It is now possible for a statically linked Python to load a C " @@ -220,14 +221,14 @@ msgid "" "Stinner in :issue:`21536`.)" msgstr "" -#: ../../whatsnew/3.8.rst:229 +#: ../../whatsnew/3.8.rst:230 msgid "" "On Unix, when Python is built in debug mode, import now also looks for C " "extensions compiled in release mode and for C extensions compiled with the " "stable ABI. (Contributed by Victor Stinner in :issue:`36722`.)" msgstr "" -#: ../../whatsnew/3.8.rst:234 +#: ../../whatsnew/3.8.rst:235 msgid "" "To embed Python into an application, a new ``--embed`` option must be passed " "to ``python3-config --libs --embed`` to get ``-lpython3.8`` (link the " @@ -236,7 +237,7 @@ msgid "" "(without ``--embed``) if the previous command fails." msgstr "" -#: ../../whatsnew/3.8.rst:240 +#: ../../whatsnew/3.8.rst:241 msgid "" "Add a pkg-config ``python-3.8-embed`` module to embed Python into an " "application: ``pkg-config python-3.8-embed --libs`` includes ``-" @@ -246,7 +247,7 @@ msgid "" "the Python version)." msgstr "" -#: ../../whatsnew/3.8.rst:246 +#: ../../whatsnew/3.8.rst:247 msgid "" "On the other hand, ``pkg-config python3.8 --libs`` no longer contains ``-" "lpython3.8``. C extensions must not be linked to libpython (except on " @@ -255,38 +256,38 @@ msgid "" "`36721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:254 +#: ../../whatsnew/3.8.rst:255 msgid "f-strings support ``=`` for self-documenting expressions and debugging" msgstr "" -#: ../../whatsnew/3.8.rst:256 +#: ../../whatsnew/3.8.rst:257 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:265 +#: ../../whatsnew/3.8.rst:266 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:272 +#: ../../whatsnew/3.8.rst:273 msgid "" "The ``=`` specifier will display the whole expression so that calculations " "can be shown::" msgstr "" -#: ../../whatsnew/3.8.rst:278 +#: ../../whatsnew/3.8.rst:279 msgid "(Contributed by Eric V. Smith and Larry Hastings in :issue:`36817`.)" msgstr "" -#: ../../whatsnew/3.8.rst:282 +#: ../../whatsnew/3.8.rst:283 msgid "PEP 578: Python Runtime Audit Hooks" msgstr "" -#: ../../whatsnew/3.8.rst:284 +#: ../../whatsnew/3.8.rst:285 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 " @@ -295,150 +296,150 @@ msgid "" "is always enabled." msgstr "" -#: ../../whatsnew/3.8.rst:290 +#: ../../whatsnew/3.8.rst:291 msgid "See :pep:`578` for full details." msgstr "完整細節請見 :pep:`578`\\ 。" -#: ../../whatsnew/3.8.rst:294 +#: ../../whatsnew/3.8.rst:295 msgid "PEP 587: Python Initialization Configuration" msgstr "" -#: ../../whatsnew/3.8.rst:296 +#: ../../whatsnew/3.8.rst:297 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:299 +#: ../../whatsnew/3.8.rst:300 msgid "New structures:" msgstr "" -#: ../../whatsnew/3.8.rst:301 +#: ../../whatsnew/3.8.rst:302 msgid ":c:type:`PyConfig`" msgstr ":c:type:`PyConfig`" -#: ../../whatsnew/3.8.rst:302 +#: ../../whatsnew/3.8.rst:303 msgid ":c:type:`PyPreConfig`" msgstr ":c:type:`PyPreConfig`" -#: ../../whatsnew/3.8.rst:303 +#: ../../whatsnew/3.8.rst:304 msgid ":c:type:`PyStatus`" msgstr ":c:type:`PyStatus`" -#: ../../whatsnew/3.8.rst:304 +#: ../../whatsnew/3.8.rst:305 msgid ":c:type:`PyWideStringList`" msgstr ":c:type:`PyWideStringList`" -#: ../../whatsnew/3.8.rst:306 +#: ../../whatsnew/3.8.rst:307 msgid "New functions:" msgstr "" -#: ../../whatsnew/3.8.rst:308 +#: ../../whatsnew/3.8.rst:309 msgid ":c:func:`PyConfig_Clear`" msgstr ":c:func:`PyConfig_Clear`" -#: ../../whatsnew/3.8.rst:309 +#: ../../whatsnew/3.8.rst:310 msgid ":c:func:`PyConfig_InitIsolatedConfig`" msgstr ":c:func:`PyConfig_InitIsolatedConfig`" -#: ../../whatsnew/3.8.rst:310 +#: ../../whatsnew/3.8.rst:311 msgid ":c:func:`PyConfig_InitPythonConfig`" msgstr ":c:func:`PyConfig_InitPythonConfig`" -#: ../../whatsnew/3.8.rst:311 +#: ../../whatsnew/3.8.rst:312 msgid ":c:func:`PyConfig_Read`" msgstr ":c:func:`PyConfig_Read`" -#: ../../whatsnew/3.8.rst:312 +#: ../../whatsnew/3.8.rst:313 msgid ":c:func:`PyConfig_SetArgv`" msgstr ":c:func:`PyConfig_SetArgv`" -#: ../../whatsnew/3.8.rst:313 +#: ../../whatsnew/3.8.rst:314 msgid ":c:func:`PyConfig_SetBytesArgv`" msgstr ":c:func:`PyConfig_SetBytesArgv`" -#: ../../whatsnew/3.8.rst:314 +#: ../../whatsnew/3.8.rst:315 msgid ":c:func:`PyConfig_SetBytesString`" msgstr ":c:func:`PyConfig_SetBytesString`" -#: ../../whatsnew/3.8.rst:315 +#: ../../whatsnew/3.8.rst:316 msgid ":c:func:`PyConfig_SetString`" msgstr ":c:func:`PyConfig_SetString`" -#: ../../whatsnew/3.8.rst:316 +#: ../../whatsnew/3.8.rst:317 msgid ":c:func:`PyPreConfig_InitIsolatedConfig`" msgstr ":c:func:`PyPreConfig_InitIsolatedConfig`" -#: ../../whatsnew/3.8.rst:317 +#: ../../whatsnew/3.8.rst:318 msgid ":c:func:`PyPreConfig_InitPythonConfig`" msgstr ":c:func:`PyPreConfig_InitPythonConfig`" -#: ../../whatsnew/3.8.rst:318 +#: ../../whatsnew/3.8.rst:319 msgid ":c:func:`PyStatus_Error`" msgstr ":c:func:`PyStatus_Error`" -#: ../../whatsnew/3.8.rst:319 +#: ../../whatsnew/3.8.rst:320 msgid ":c:func:`PyStatus_Exception`" msgstr ":c:func:`PyStatus_Exception`" -#: ../../whatsnew/3.8.rst:320 +#: ../../whatsnew/3.8.rst:321 msgid ":c:func:`PyStatus_Exit`" msgstr ":c:func:`PyStatus_Exit`" -#: ../../whatsnew/3.8.rst:321 +#: ../../whatsnew/3.8.rst:322 msgid ":c:func:`PyStatus_IsError`" msgstr ":c:func:`PyStatus_IsError`" -#: ../../whatsnew/3.8.rst:322 +#: ../../whatsnew/3.8.rst:323 msgid ":c:func:`PyStatus_IsExit`" msgstr ":c:func:`PyStatus_IsExit`" -#: ../../whatsnew/3.8.rst:323 +#: ../../whatsnew/3.8.rst:324 msgid ":c:func:`PyStatus_NoMemory`" msgstr ":c:func:`PyStatus_NoMemory`" -#: ../../whatsnew/3.8.rst:324 +#: ../../whatsnew/3.8.rst:325 msgid ":c:func:`PyStatus_Ok`" msgstr ":c:func:`PyStatus_Ok`" -#: ../../whatsnew/3.8.rst:325 +#: ../../whatsnew/3.8.rst:326 msgid ":c:func:`PyWideStringList_Append`" msgstr ":c:func:`PyWideStringList_Append`" -#: ../../whatsnew/3.8.rst:326 +#: ../../whatsnew/3.8.rst:327 msgid ":c:func:`PyWideStringList_Insert`" msgstr ":c:func:`PyWideStringList_Insert`" -#: ../../whatsnew/3.8.rst:327 +#: ../../whatsnew/3.8.rst:328 msgid ":c:func:`Py_BytesMain`" msgstr ":c:func:`Py_BytesMain`" -#: ../../whatsnew/3.8.rst:328 +#: ../../whatsnew/3.8.rst:329 msgid ":c:func:`Py_ExitStatusException`" msgstr ":c:func:`Py_ExitStatusException`" -#: ../../whatsnew/3.8.rst:329 +#: ../../whatsnew/3.8.rst:330 msgid ":c:func:`Py_InitializeFromConfig`" msgstr ":c:func:`Py_InitializeFromConfig`" -#: ../../whatsnew/3.8.rst:330 +#: ../../whatsnew/3.8.rst:331 msgid ":c:func:`Py_PreInitialize`" msgstr ":c:func:`Py_PreInitialize`" -#: ../../whatsnew/3.8.rst:331 +#: ../../whatsnew/3.8.rst:332 msgid ":c:func:`Py_PreInitializeFromArgs`" msgstr ":c:func:`Py_PreInitializeFromArgs`" -#: ../../whatsnew/3.8.rst:332 +#: ../../whatsnew/3.8.rst:333 msgid ":c:func:`Py_PreInitializeFromBytesArgs`" msgstr ":c:func:`Py_PreInitializeFromBytesArgs`" -#: ../../whatsnew/3.8.rst:333 +#: ../../whatsnew/3.8.rst:334 msgid ":c:func:`Py_RunMain`" msgstr ":c:func:`Py_RunMain`" -#: ../../whatsnew/3.8.rst:335 +#: ../../whatsnew/3.8.rst:336 msgid "" "This PEP also adds ``_PyRuntimeState.preconfig`` (:c:type:`PyPreConfig` " "type) and ``PyInterpreterState.config`` (:c:type:`PyConfig` type) fields to " @@ -447,52 +448,52 @@ msgid "" "private variables." msgstr "" -#: ../../whatsnew/3.8.rst:341 +#: ../../whatsnew/3.8.rst:342 msgid "" "See :ref:`Python Initialization Configuration ` for the " "documentation." msgstr "" -#: ../../whatsnew/3.8.rst:344 +#: ../../whatsnew/3.8.rst:345 msgid "See :pep:`587` for a full description." msgstr "完整敘述請見 :pep:`587`\\ 。" -#: ../../whatsnew/3.8.rst:346 +#: ../../whatsnew/3.8.rst:347 msgid "(Contributed by Victor Stinner in :issue:`36763`.)" msgstr "" -#: ../../whatsnew/3.8.rst:350 +#: ../../whatsnew/3.8.rst:351 msgid "PEP 590: Vectorcall: a fast calling protocol for CPython" msgstr "" -#: ../../whatsnew/3.8.rst:352 +#: ../../whatsnew/3.8.rst:353 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:358 +#: ../../whatsnew/3.8.rst:359 msgid "" "This is currently provisional. The aim is to make it fully public in Python " "3.9." msgstr "" -#: ../../whatsnew/3.8.rst:361 +#: ../../whatsnew/3.8.rst:362 msgid "See :pep:`590` for a full description." msgstr "完整敘述請見 :pep:`590`\\ 。" -#: ../../whatsnew/3.8.rst:363 +#: ../../whatsnew/3.8.rst:364 msgid "" "(Contributed by Jeroen Demeyer, Mark Shannon and Petr Viktorin in :issue:" "`36974`.)" msgstr "" -#: ../../whatsnew/3.8.rst:367 +#: ../../whatsnew/3.8.rst:368 msgid "Pickle protocol 5 with out-of-band data buffers" msgstr "" -#: ../../whatsnew/3.8.rst:369 +#: ../../whatsnew/3.8.rst:370 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 " @@ -500,33 +501,33 @@ msgid "" "by applying custom techniques such as data-dependent compression." msgstr "" -#: ../../whatsnew/3.8.rst:374 +#: ../../whatsnew/3.8.rst:375 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:378 +#: ../../whatsnew/3.8.rst:379 msgid "See :pep:`574` for a full description." msgstr "完整敘述請見 :pep:`574`\\ 。" -#: ../../whatsnew/3.8.rst:380 +#: ../../whatsnew/3.8.rst:381 msgid "(Contributed by Antoine Pitrou in :issue:`36785`.)" msgstr "" -#: ../../whatsnew/3.8.rst:384 +#: ../../whatsnew/3.8.rst:385 msgid "Other Language Changes" msgstr "" -#: ../../whatsnew/3.8.rst:386 +#: ../../whatsnew/3.8.rst:387 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:391 +#: ../../whatsnew/3.8.rst:392 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:" @@ -536,7 +537,7 @@ msgid "" "`33073` and Raymond Hettinger in :issue:`37819`.)" msgstr "" -#: ../../whatsnew/3.8.rst:399 +#: ../../whatsnew/3.8.rst:400 msgid "" "Constructors of :class:`int`, :class:`float` and :class:`complex` will now " "use the :meth:`~object.__index__` special method, if available and the " @@ -545,23 +546,23 @@ msgid "" "Storchaka in :issue:`20092`.)" msgstr "" -#: ../../whatsnew/3.8.rst:405 +#: ../../whatsnew/3.8.rst:406 msgid "" "Added support of ``\\N{name}`` escapes in :mod:`regular expressions `::" msgstr "" -#: ../../whatsnew/3.8.rst:412 +#: ../../whatsnew/3.8.rst:413 msgid "" "(Contributed by Jonathan Eunice and Serhiy Storchaka in :issue:`30688`.)" msgstr "" -#: ../../whatsnew/3.8.rst:414 +#: ../../whatsnew/3.8.rst:415 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:417 +#: ../../whatsnew/3.8.rst:418 msgid "" "The syntax allowed for keyword names in function calls was further " "restricted. In particular, ``f((keyword)=arg)`` is no longer allowed. It was " @@ -570,18 +571,18 @@ msgid "" "issue:`34641`.)" msgstr "" -#: ../../whatsnew/3.8.rst:423 +#: ../../whatsnew/3.8.rst:424 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:435 +#: ../../whatsnew/3.8.rst:436 msgid "(Contributed by David Cuthbert and Jordan Chapman in :issue:`32117`.)" msgstr "" -#: ../../whatsnew/3.8.rst:437 +#: ../../whatsnew/3.8.rst:438 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 " @@ -589,7 +590,7 @@ msgid "" "callable. (Contributed by Serhiy Storchaka in :issue:`15248`.)" msgstr "" -#: ../../whatsnew/3.8.rst:443 +#: ../../whatsnew/3.8.rst:444 msgid "" "Arithmetic operations between subclasses of :class:`datetime.date` or :class:" "`datetime.datetime` and :class:`datetime.timedelta` objects now return an " @@ -599,7 +600,7 @@ msgid "" "datetime.astimezone`. (Contributed by Paul Ganssle in :issue:`32417`.)" msgstr "" -#: ../../whatsnew/3.8.rst:451 +#: ../../whatsnew/3.8.rst:452 msgid "" "When the Python interpreter is interrupted by Ctrl-C (SIGINT) and the " "resulting :exc:`KeyboardInterrupt` exception is not caught, the Python " @@ -609,7 +610,7 @@ msgid "" "sessions. (Contributed by Google via Gregory P. Smith in :issue:`1054041`.)" msgstr "" -#: ../../whatsnew/3.8.rst:458 +#: ../../whatsnew/3.8.rst:459 msgid "" "Some advanced styles of programming require updating the :class:`types." "CodeType` object for an existing function. Since code objects are " @@ -619,17 +620,17 @@ msgid "" "altered parameters." msgstr "" -#: ../../whatsnew/3.8.rst:465 +#: ../../whatsnew/3.8.rst:466 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:477 +#: ../../whatsnew/3.8.rst:478 msgid "(Contributed by Victor Stinner in :issue:`37032`.)" msgstr "" -#: ../../whatsnew/3.8.rst:479 +#: ../../whatsnew/3.8.rst:480 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 " @@ -640,7 +641,7 @@ msgid "" "38 modulo 137, write::" msgstr "" -#: ../../whatsnew/3.8.rst:493 +#: ../../whatsnew/3.8.rst:494 msgid "" "Modular inverses arise in the solution of `linear Diophantine equations " "`_. For example, to find " @@ -648,28 +649,28 @@ msgid "" "(mod 147)`` then solve:" msgstr "" -#: ../../whatsnew/3.8.rst:503 +#: ../../whatsnew/3.8.rst:504 msgid "(Contributed by Mark Dickinson in :issue:`36027`.)" msgstr "" -#: ../../whatsnew/3.8.rst:505 +#: ../../whatsnew/3.8.rst:506 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:520 +#: ../../whatsnew/3.8.rst:521 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:530 +#: ../../whatsnew/3.8.rst:531 msgid "(Contributed by Jörn Heissler in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:532 +#: ../../whatsnew/3.8.rst:533 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 " @@ -680,102 +681,102 @@ msgid "" "issue:`35900`.)" msgstr "" -#: ../../whatsnew/3.8.rst:541 +#: ../../whatsnew/3.8.rst:542 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.8.rst:543 +#: ../../whatsnew/3.8.rst:544 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:562 +#: ../../whatsnew/3.8.rst:563 msgid "(Contributed by Barry Warsaw and Jason R. Coombs in :issue:`34632`.)" msgstr "" -#: ../../whatsnew/3.8.rst:566 +#: ../../whatsnew/3.8.rst:567 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.8.rst:569 +#: ../../whatsnew/3.8.rst:570 msgid "ast" msgstr "ast" -#: ../../whatsnew/3.8.rst:571 +#: ../../whatsnew/3.8.rst:572 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:575 +#: ../../whatsnew/3.8.rst:576 msgid "" "New function :func:`ast.get_source_segment` returns the source code for a " "specific AST node." msgstr "" -#: ../../whatsnew/3.8.rst:578 +#: ../../whatsnew/3.8.rst:579 msgid "(Contributed by Ivan Levkivskyi in :issue:`33416`.)" msgstr "" -#: ../../whatsnew/3.8.rst:580 +#: ../../whatsnew/3.8.rst:581 msgid "The :func:`ast.parse` function has some new flags:" msgstr "" -#: ../../whatsnew/3.8.rst:582 +#: ../../whatsnew/3.8.rst:583 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:585 +#: ../../whatsnew/3.8.rst:586 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:588 +#: ../../whatsnew/3.8.rst:589 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:592 +#: ../../whatsnew/3.8.rst:593 msgid "(Contributed by Guido van Rossum in :issue:`35766`.)" msgstr "" -#: ../../whatsnew/3.8.rst:596 +#: ../../whatsnew/3.8.rst:597 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.8.rst:598 +#: ../../whatsnew/3.8.rst:599 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:610 +#: ../../whatsnew/3.8.rst:611 msgid "This is *roughly* equivalent to::" msgstr "" "這\\ *大致*\\ 等價於:\n" "\n" "::" -#: ../../whatsnew/3.8.rst:627 +#: ../../whatsnew/3.8.rst:628 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:630 +#: ../../whatsnew/3.8.rst:631 msgid "(Contributed by Yury Selivanov in :issue:`32314`.)" msgstr "" -#: ../../whatsnew/3.8.rst:632 +#: ../../whatsnew/3.8.rst:633 msgid "" "Running ``python -m asyncio`` launches a natively async REPL. This allows " "rapid experimentation with code that has a top-level :keyword:`await`. " @@ -783,11 +784,11 @@ msgid "" "spawn a new event loop on every invocation:" msgstr "" -#: ../../whatsnew/3.8.rst:647 +#: ../../whatsnew/3.8.rst:648 msgid "(Contributed by Yury Selivanov in :issue:`37028`.)" msgstr "" -#: ../../whatsnew/3.8.rst:649 ../../whatsnew/3.8.rst:1965 +#: ../../whatsnew/3.8.rst:650 ../../whatsnew/3.8.rst:1966 msgid "" "The exception :class:`asyncio.CancelledError` now inherits from :class:" "`BaseException` rather than :class:`Exception` and no longer inherits from :" @@ -795,32 +796,32 @@ msgid "" "in :issue:`32528`.)" msgstr "" -#: ../../whatsnew/3.8.rst:654 +#: ../../whatsnew/3.8.rst:655 msgid "" "On Windows, the default event loop is now :class:`~asyncio." "ProactorEventLoop`. (Contributed by Victor Stinner in :issue:`34687`.)" msgstr "" -#: ../../whatsnew/3.8.rst:657 +#: ../../whatsnew/3.8.rst:658 msgid "" ":class:`~asyncio.ProactorEventLoop` now also supports UDP. (Contributed by " "Adam Meily and Andrew Svetlov in :issue:`29883`.)" msgstr "" -#: ../../whatsnew/3.8.rst:660 +#: ../../whatsnew/3.8.rst:661 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:664 +#: ../../whatsnew/3.8.rst:665 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:668 +#: ../../whatsnew/3.8.rst:669 msgid "" "Asyncio tasks can now be named, either by passing the ``name`` keyword " "argument to :func:`asyncio.create_task` or the :meth:`~asyncio.loop." @@ -831,7 +832,7 @@ msgid "" "issue:`34270`.)" msgstr "" -#: ../../whatsnew/3.8.rst:676 +#: ../../whatsnew/3.8.rst:677 msgid "" "Added support for `Happy Eyeballs `_ to :func:`asyncio.loop.create_connection`. To specify the " @@ -841,11 +842,11 @@ msgid "" "connect using both. (Contributed by twisteroid ambassador in :issue:`33530`.)" msgstr "" -#: ../../whatsnew/3.8.rst:686 +#: ../../whatsnew/3.8.rst:687 msgid "builtins" msgstr "builtins" -#: ../../whatsnew/3.8.rst:688 +#: ../../whatsnew/3.8.rst:689 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:" @@ -855,11 +856,11 @@ msgid "" "(Contributed by Matthias Bussonnier in :issue:`34616`)" msgstr "" -#: ../../whatsnew/3.8.rst:697 +#: ../../whatsnew/3.8.rst:698 msgid "collections" msgstr "collections" -#: ../../whatsnew/3.8.rst:699 +#: ../../whatsnew/3.8.rst:700 msgid "" "The :meth:`~collections.somenamedtuple._asdict` method for :func:" "`collections.namedtuple` now returns a :class:`dict` instead of a :class:" @@ -870,25 +871,25 @@ msgid "" "issue:`35864`.)" msgstr "" -#: ../../whatsnew/3.8.rst:709 +#: ../../whatsnew/3.8.rst:710 msgid "cProfile" msgstr "cProfile" -#: ../../whatsnew/3.8.rst:711 +#: ../../whatsnew/3.8.rst:712 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:720 +#: ../../whatsnew/3.8.rst:721 msgid "(Contributed by Scott Sanderson in :issue:`29235`.)" msgstr "" -#: ../../whatsnew/3.8.rst:724 +#: ../../whatsnew/3.8.rst:725 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.8.rst:726 +#: ../../whatsnew/3.8.rst:727 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 " @@ -896,22 +897,22 @@ msgid "" "in :issue:`34003`.)" msgstr "" -#: ../../whatsnew/3.8.rst:733 +#: ../../whatsnew/3.8.rst:734 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.8.rst:735 +#: ../../whatsnew/3.8.rst:736 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:741 +#: ../../whatsnew/3.8.rst:742 msgid "ctypes" msgstr "ctypes" -#: ../../whatsnew/3.8.rst:743 +#: ../../whatsnew/3.8.rst:744 msgid "" "On Windows, :class:`~ctypes.CDLL` and subclasses now accept a *winmode* " "parameter to specify flags for the underlying ``LoadLibraryEx`` call. The " @@ -921,11 +922,11 @@ msgid "" "add_dll_directory`. (Contributed by Steve Dower in :issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:752 +#: ../../whatsnew/3.8.rst:753 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.8.rst:754 +#: ../../whatsnew/3.8.rst:755 msgid "" "Added new alternate constructors :meth:`datetime.date.fromisocalendar` and :" "meth:`datetime.datetime.fromisocalendar`, which construct :class:`date` and :" @@ -934,85 +935,85 @@ msgid "" "(Contributed by Paul Ganssle in :issue:`36004`.)" msgstr "" -#: ../../whatsnew/3.8.rst:762 +#: ../../whatsnew/3.8.rst:763 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.8.rst:764 +#: ../../whatsnew/3.8.rst:765 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:775 +#: ../../whatsnew/3.8.rst:776 msgid "(Contributed by Raymond Hettinger in :issue:`36772`.)" msgstr "" -#: ../../whatsnew/3.8.rst:777 +#: ../../whatsnew/3.8.rst:778 msgid "" "Added a new :func:`functools.cached_property` decorator, for computed " "properties cached for the life of the instance. ::" msgstr "" -#: ../../whatsnew/3.8.rst:791 +#: ../../whatsnew/3.8.rst:792 msgid "(Contributed by Carl Meyer in :issue:`21145`)" msgstr "" -#: ../../whatsnew/3.8.rst:794 +#: ../../whatsnew/3.8.rst:795 msgid "" "Added a new :func:`functools.singledispatchmethod` decorator that converts " "methods into :term:`generic functions ` using :term:" "`single dispatch`::" msgstr "" -#: ../../whatsnew/3.8.rst:816 +#: ../../whatsnew/3.8.rst:817 msgid "(Contributed by Ethan Smith in :issue:`32380`)" msgstr "" -#: ../../whatsnew/3.8.rst:819 +#: ../../whatsnew/3.8.rst:820 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.8.rst:821 +#: ../../whatsnew/3.8.rst:822 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:827 +#: ../../whatsnew/3.8.rst:828 msgid "gettext" msgstr "gettext" -#: ../../whatsnew/3.8.rst:829 +#: ../../whatsnew/3.8.rst:830 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:834 +#: ../../whatsnew/3.8.rst:835 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.8.rst:836 +#: ../../whatsnew/3.8.rst:837 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:839 +#: ../../whatsnew/3.8.rst:840 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:846 +#: ../../whatsnew/3.8.rst:847 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.8.rst:848 +#: ../../whatsnew/3.8.rst:849 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. " @@ -1022,7 +1023,7 @@ msgid "" "button. (Contributed by Tal Einat in :issue:`1529353`.)" msgstr "" -#: ../../whatsnew/3.8.rst:855 +#: ../../whatsnew/3.8.rst:856 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 " @@ -1031,7 +1032,7 @@ msgid "" "Sabella, Terry Jan Reedy, and others in :issue:`5680` and :issue:`37627`.)" msgstr "" -#: ../../whatsnew/3.8.rst:861 +#: ../../whatsnew/3.8.rst:862 msgid "" "Added optional line numbers for IDLE editor windows. Windows open without " "line numbers unless set otherwise in the General tab of the configuration " @@ -1040,7 +1041,7 @@ msgid "" "`17535`.)" msgstr "" -#: ../../whatsnew/3.8.rst:867 +#: ../../whatsnew/3.8.rst:868 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. " @@ -1050,37 +1051,37 @@ msgid "" "solved by Serhiy Storchaka in :issue:`13153`.)" msgstr "" -#: ../../whatsnew/3.8.rst:874 +#: ../../whatsnew/3.8.rst:875 msgid "New in 3.8.1:" msgstr "" -#: ../../whatsnew/3.8.rst:876 +#: ../../whatsnew/3.8.rst:877 msgid "" "Add option to toggle cursor blink off. (Contributed by Zackery Spytz in :" "issue:`4603`.)" msgstr "" -#: ../../whatsnew/3.8.rst:879 +#: ../../whatsnew/3.8.rst:880 msgid "" "Escape key now closes IDLE completion windows. (Contributed by Johnny " "Najera in :issue:`38944`.)" msgstr "" -#: ../../whatsnew/3.8.rst:882 +#: ../../whatsnew/3.8.rst:883 msgid "The changes above have been backported to 3.7 maintenance releases." msgstr "" -#: ../../whatsnew/3.8.rst:884 +#: ../../whatsnew/3.8.rst:885 msgid "" "Add keywords to module name completion list. (Contributed by Terry J. Reedy " "in :issue:`37765`.)" msgstr "" -#: ../../whatsnew/3.8.rst:888 +#: ../../whatsnew/3.8.rst:889 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.8.rst:890 +#: ../../whatsnew/3.8.rst:891 msgid "" "The :func:`inspect.getdoc` function can now find docstrings for " "``__slots__`` if that attribute is a :class:`dict` where the values are " @@ -1088,15 +1089,15 @@ msgid "" "have for :func:`property`, :func:`classmethod`, and :func:`staticmethod`::" msgstr "" -#: ../../whatsnew/3.8.rst:902 +#: ../../whatsnew/3.8.rst:903 msgid "(Contributed by Raymond Hettinger in :issue:`36326`.)" msgstr "" -#: ../../whatsnew/3.8.rst:906 +#: ../../whatsnew/3.8.rst:907 msgid "io" msgstr "io" -#: ../../whatsnew/3.8.rst:908 +#: ../../whatsnew/3.8.rst:909 msgid "" "In development mode (:option:`-X` ``env``) and in :ref:`debug build `, the :class:`io.IOBase` finalizer now logs the exception if the " @@ -1104,35 +1105,35 @@ msgid "" "release build. (Contributed by Victor Stinner in :issue:`18748`.)" msgstr "" -#: ../../whatsnew/3.8.rst:915 +#: ../../whatsnew/3.8.rst:916 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.8.rst:917 +#: ../../whatsnew/3.8.rst:918 msgid "" "The :func:`itertools.accumulate` function added an option *initial* keyword " "argument to specify an initial value::" msgstr "" -#: ../../whatsnew/3.8.rst:924 +#: ../../whatsnew/3.8.rst:925 msgid "(Contributed by Lisa Roach in :issue:`34659`.)" msgstr "" -#: ../../whatsnew/3.8.rst:928 +#: ../../whatsnew/3.8.rst:929 msgid "json.tool" msgstr "json.tool" -#: ../../whatsnew/3.8.rst:930 +#: ../../whatsnew/3.8.rst:931 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:935 +#: ../../whatsnew/3.8.rst:936 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.8.rst:937 +#: ../../whatsnew/3.8.rst:938 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 " @@ -1140,7 +1141,7 @@ msgid "" "arguments." msgstr "" -#: ../../whatsnew/3.8.rst:942 +#: ../../whatsnew/3.8.rst:943 msgid "" "This solves a long-standing problem. Once a logger or *basicConfig()* had " "been called, subsequent calls to *basicConfig()* were silently ignored. This " @@ -1148,53 +1149,53 @@ msgid "" "configuration options using the interactive prompt or a Jupyter notebook." msgstr "" -#: ../../whatsnew/3.8.rst:948 +#: ../../whatsnew/3.8.rst:949 msgid "" "(Suggested by Raymond Hettinger, implemented by Dong-hee Na, and reviewed by " "Vinay Sajip in :issue:`33897`.)" msgstr "" -#: ../../whatsnew/3.8.rst:953 +#: ../../whatsnew/3.8.rst:954 msgid "math" msgstr "math" -#: ../../whatsnew/3.8.rst:955 +#: ../../whatsnew/3.8.rst:956 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:958 +#: ../../whatsnew/3.8.rst:959 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:962 +#: ../../whatsnew/3.8.rst:963 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:971 +#: ../../whatsnew/3.8.rst:972 msgid "(Contributed by Pablo Galindo in :issue:`35606`.)" msgstr "" -#: ../../whatsnew/3.8.rst:973 +#: ../../whatsnew/3.8.rst:974 msgid "" "Added two new combinatoric functions :func:`math.perm` and :func:`math." "comb`::" msgstr "" -#: ../../whatsnew/3.8.rst:980 +#: ../../whatsnew/3.8.rst:981 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:983 +#: ../../whatsnew/3.8.rst:984 msgid "" "Added a new function :func:`math.isqrt` for computing accurate integer " "square roots without conversion to floating point. The new function " @@ -1202,48 +1203,48 @@ msgid "" "but slower than :func:`math.sqrt`::" msgstr "" -#: ../../whatsnew/3.8.rst:995 +#: ../../whatsnew/3.8.rst:996 msgid "(Contributed by Mark Dickinson in :issue:`36887`.)" msgstr "" -#: ../../whatsnew/3.8.rst:997 +#: ../../whatsnew/3.8.rst:998 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:1002 +#: ../../whatsnew/3.8.rst:1003 msgid "mmap" msgstr "mmap" -#: ../../whatsnew/3.8.rst:1004 +#: ../../whatsnew/3.8.rst:1005 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:1010 +#: ../../whatsnew/3.8.rst:1011 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.8.rst:1012 +#: ../../whatsnew/3.8.rst:1013 msgid "" "Added new :mod:`multiprocessing.shared_memory` module. (Contributed by Davin " "Potts in :issue:`35813`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1015 +#: ../../whatsnew/3.8.rst:1016 msgid "" "On macOS, the *spawn* start method is now used by default. (Contributed by " "Victor Stinner in :issue:`33725`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1020 +#: ../../whatsnew/3.8.rst:1021 msgid "os" msgstr "os" -#: ../../whatsnew/3.8.rst:1022 +#: ../../whatsnew/3.8.rst:1023 msgid "" "Added new function :func:`~os.add_dll_directory` on Windows for providing " "additional search paths for native dependencies when importing extension " @@ -1251,14 +1252,14 @@ msgid "" "issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1027 +#: ../../whatsnew/3.8.rst:1028 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:1031 +#: ../../whatsnew/3.8.rst:1032 msgid "" "On Windows, much of the manual logic for handling reparse points (including " "symlinks and directory junctions) has been delegated to the operating " @@ -1271,7 +1272,7 @@ msgid "" "st_reparse_tag` attribute." msgstr "" -#: ../../whatsnew/3.8.rst:1040 +#: ../../whatsnew/3.8.rst:1041 msgid "" "On Windows, :func:`os.readlink` is now able to read directory junctions. " "Note that :func:`~os.path.islink` will return ``False`` for directory " @@ -1280,15 +1281,15 @@ msgid "" "readlink` may now treat junctions as links." msgstr "" -#: ../../whatsnew/3.8.rst:1046 ../../whatsnew/3.8.rst:1071 +#: ../../whatsnew/3.8.rst:1047 ../../whatsnew/3.8.rst:1072 msgid "(Contributed by Steve Dower in :issue:`37834`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1050 +#: ../../whatsnew/3.8.rst:1051 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.8.rst:1052 +#: ../../whatsnew/3.8.rst:1053 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." @@ -1299,7 +1300,7 @@ msgid "" "Storchaka in :issue:`33721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1060 ../../whatsnew/3.8.rst:1960 +#: ../../whatsnew/3.8.rst:1061 ../../whatsnew/3.8.rst:1961 msgid "" ":func:`~os.path.expanduser` on Windows now prefers the :envvar:`USERPROFILE` " "environment variable and does not use :envvar:`HOME`, which is not normally " @@ -1307,23 +1308,23 @@ msgid "" "`36264`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1065 +#: ../../whatsnew/3.8.rst:1066 msgid "" ":func:`~os.path.isdir` on Windows no longer returns ``True`` for a link to a " "non-existent directory." msgstr "" -#: ../../whatsnew/3.8.rst:1068 +#: ../../whatsnew/3.8.rst:1069 msgid "" ":func:`~os.path.realpath` on Windows now resolves reparse points, including " "symlinks and directory junctions." msgstr "" -#: ../../whatsnew/3.8.rst:1075 +#: ../../whatsnew/3.8.rst:1076 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.8.rst:1077 +#: ../../whatsnew/3.8.rst:1078 msgid "" ":mod:`pathlib.Path` methods that return a boolean result like :meth:" "`~pathlib.Path.exists()`, :meth:`~pathlib.Path.is_dir()`, :meth:`~pathlib." @@ -1336,17 +1337,17 @@ msgid "" "`33721`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1087 +#: ../../whatsnew/3.8.rst:1088 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:1093 +#: ../../whatsnew/3.8.rst:1094 msgid "pickle" msgstr "pickle" -#: ../../whatsnew/3.8.rst:1095 +#: ../../whatsnew/3.8.rst:1096 msgid "" ":mod:`pickle` extensions subclassing the C-optimized :class:`~pickle." "Pickler` can now override the pickling logic of functions and classes by " @@ -1354,22 +1355,22 @@ msgid "" "(Contributed by Pierre Glaser and Olivier Grisel in :issue:`35900`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1102 +#: ../../whatsnew/3.8.rst:1103 msgid "plistlib" msgstr "plistlib" -#: ../../whatsnew/3.8.rst:1104 +#: ../../whatsnew/3.8.rst:1105 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:1110 +#: ../../whatsnew/3.8.rst:1111 msgid "pprint" msgstr "pprint" -#: ../../whatsnew/3.8.rst:1112 +#: ../../whatsnew/3.8.rst:1113 msgid "" "The :mod:`pprint` module added a *sort_dicts* parameter to several " "functions. By default, those functions continue to sort dictionaries before " @@ -1378,47 +1379,47 @@ msgid "" "for comparison to JSON inputs during debugging." msgstr "" -#: ../../whatsnew/3.8.rst:1118 +#: ../../whatsnew/3.8.rst:1119 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:1132 +#: ../../whatsnew/3.8.rst:1133 msgid "(Contributed by Rémi Lapeyre in :issue:`30670`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1136 +#: ../../whatsnew/3.8.rst:1137 msgid "py_compile" msgstr "py_compile" -#: ../../whatsnew/3.8.rst:1138 +#: ../../whatsnew/3.8.rst:1139 msgid "" ":func:`py_compile.compile` now supports silent mode. (Contributed by Joannah " "Nanjekye in :issue:`22640`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1143 +#: ../../whatsnew/3.8.rst:1144 msgid "shlex" msgstr "shlex" -#: ../../whatsnew/3.8.rst:1145 +#: ../../whatsnew/3.8.rst:1146 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:1150 +#: ../../whatsnew/3.8.rst:1151 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.8.rst:1152 +#: ../../whatsnew/3.8.rst:1153 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:1155 +#: ../../whatsnew/3.8.rst:1156 msgid "" ":func:`shutil.make_archive` now defaults to the modern pax (POSIX.1-2001) " "format for new archives to improve portability and standards conformance, " @@ -1426,18 +1427,18 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`30661`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1160 +#: ../../whatsnew/3.8.rst:1161 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:1166 +#: ../../whatsnew/3.8.rst:1167 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.8.rst:1168 +#: ../../whatsnew/3.8.rst:1169 msgid "" "Added :meth:`~socket.create_server()` and :meth:`~socket." "has_dualstack_ipv6()` convenience functions to automate the necessary tasks " @@ -1446,66 +1447,66 @@ msgid "" "Rodolà in :issue:`17561`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1173 +#: ../../whatsnew/3.8.rst:1174 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:1179 +#: ../../whatsnew/3.8.rst:1180 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.8.rst:1181 +#: ../../whatsnew/3.8.rst:1182 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:1188 +#: ../../whatsnew/3.8.rst:1189 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.8.rst:1190 +#: ../../whatsnew/3.8.rst:1191 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:1194 +#: ../../whatsnew/3.8.rst:1195 msgid "" "Added :func:`statistics.geometric_mean()` (Contributed by Raymond Hettinger " "in :issue:`27181`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1197 +#: ../../whatsnew/3.8.rst:1198 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:1200 +#: ../../whatsnew/3.8.rst:1201 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:1204 +#: ../../whatsnew/3.8.rst:1205 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:1234 +#: ../../whatsnew/3.8.rst:1235 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.8.rst:1236 +#: ../../whatsnew/3.8.rst:1237 msgid "" "Add new :func:`sys.unraisablehook` function which can be overridden to " "control how \"unraisable exceptions\" are handled. It is called when an " @@ -1514,11 +1515,11 @@ msgid "" "(:func:`gc.collect`). (Contributed by Victor Stinner in :issue:`36829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1245 +#: ../../whatsnew/3.8.rst:1246 msgid "tarfile" msgstr "tarfile" -#: ../../whatsnew/3.8.rst:1247 +#: ../../whatsnew/3.8.rst:1248 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 " @@ -1527,11 +1528,11 @@ msgid "" "(Contributed by C.A.M. Gerlach in :issue:`36268`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1255 +#: ../../whatsnew/3.8.rst:1256 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.8.rst:1257 +#: ../../whatsnew/3.8.rst:1258 msgid "" "Add a new :func:`threading.excepthook` function which handles uncaught :meth:" "`threading.Thread.run` exception. It can be overridden to control how " @@ -1539,7 +1540,7 @@ msgid "" "by Victor Stinner in :issue:`1230540`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1262 +#: ../../whatsnew/3.8.rst:1263 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 " @@ -1549,11 +1550,11 @@ msgid "" "by Jake Tesler in :issue:`36084`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1272 +#: ../../whatsnew/3.8.rst:1273 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.8.rst:1274 +#: ../../whatsnew/3.8.rst:1275 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 " @@ -1561,11 +1562,11 @@ msgid "" "Askar in :issue:`33899`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1281 +#: ../../whatsnew/3.8.rst:1282 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.8.rst:1283 +#: ../../whatsnew/3.8.rst:1284 msgid "" "Added methods :meth:`~tkinter.Spinbox.selection_from`, :meth:`~tkinter." "Spinbox.selection_present`, :meth:`~tkinter.Spinbox.selection_range` and :" @@ -1573,38 +1574,38 @@ msgid "" "(Contributed by Juliette Monsel in :issue:`34829`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1290 +#: ../../whatsnew/3.8.rst:1291 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:1294 +#: ../../whatsnew/3.8.rst:1295 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:1301 +#: ../../whatsnew/3.8.rst:1302 msgid "time" msgstr "time" -#: ../../whatsnew/3.8.rst:1303 +#: ../../whatsnew/3.8.rst:1304 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:1308 +#: ../../whatsnew/3.8.rst:1309 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.8.rst:1310 +#: ../../whatsnew/3.8.rst:1311 msgid "The :mod:`typing` module incorporates several new features:" msgstr "" -#: ../../whatsnew/3.8.rst:1312 +#: ../../whatsnew/3.8.rst:1313 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 " @@ -1612,46 +1613,46 @@ msgid "" "optional::" msgstr "" -#: ../../whatsnew/3.8.rst:1322 +#: ../../whatsnew/3.8.rst:1323 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:1329 +#: ../../whatsnew/3.8.rst:1330 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:1336 +#: ../../whatsnew/3.8.rst:1337 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:1340 +#: ../../whatsnew/3.8.rst:1341 msgid "New protocol class :class:`typing.SupportsIndex`." msgstr "" -#: ../../whatsnew/3.8.rst:1342 +#: ../../whatsnew/3.8.rst:1343 msgid "New functions :func:`typing.get_origin` and :func:`typing.get_args`." msgstr "" -#: ../../whatsnew/3.8.rst:1346 +#: ../../whatsnew/3.8.rst:1347 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.8.rst:1348 +#: ../../whatsnew/3.8.rst:1349 msgid "" "The :mod:`unicodedata` module has been upgraded to use the `Unicode 12.1.0 " "`_ release." msgstr "" -#: ../../whatsnew/3.8.rst:1351 +#: ../../whatsnew/3.8.rst:1352 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 " @@ -1659,11 +1660,11 @@ msgid "" "Greg Price in :issue:`32285` and :issue:`37966`)." msgstr "" -#: ../../whatsnew/3.8.rst:1358 +#: ../../whatsnew/3.8.rst:1359 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.8.rst:1360 +#: ../../whatsnew/3.8.rst:1361 msgid "" "Added :class:`~unittest.mock.AsyncMock` to support an asynchronous version " "of :class:`~unittest.mock.Mock`. Appropriate new assert functions for " @@ -1671,7 +1672,7 @@ msgid "" "`26467`)." msgstr "" -#: ../../whatsnew/3.8.rst:1365 +#: ../../whatsnew/3.8.rst:1366 msgid "" "Added :func:`~unittest.addModuleCleanup()` and :meth:`~unittest.TestCase." "addClassCleanup()` to unittest to support cleanups for :func:`~unittest." @@ -1679,60 +1680,60 @@ msgid "" "Lisa Roach in :issue:`24412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1371 +#: ../../whatsnew/3.8.rst:1372 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:1374 +#: ../../whatsnew/3.8.rst:1375 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:1378 +#: ../../whatsnew/3.8.rst:1379 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../whatsnew/3.8.rst:1401 +#: ../../whatsnew/3.8.rst:1402 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.8.rst:1403 +#: ../../whatsnew/3.8.rst:1404 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:1409 +#: ../../whatsnew/3.8.rst:1410 msgid "weakref" msgstr "weakref" -#: ../../whatsnew/3.8.rst:1411 +#: ../../whatsnew/3.8.rst:1412 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:1417 +#: ../../whatsnew/3.8.rst:1418 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.8.rst:1419 +#: ../../whatsnew/3.8.rst:1420 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:1424 +#: ../../whatsnew/3.8.rst:1425 msgid "" "The ``.find*()`` methods in the :mod:`xml.etree.ElementTree` module support " "wildcard searches like ``{*}tag`` which ignores the namespace and " @@ -1740,14 +1741,14 @@ msgid "" "by Stefan Behnel in :issue:`28238`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1429 +#: ../../whatsnew/3.8.rst:1430 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:1433 +#: ../../whatsnew/3.8.rst:1434 msgid "" "The target object of :class:`xml.etree.ElementTree.XMLParser` can receive " "namespace declaration events through the new callback methods ``start_ns()`` " @@ -1757,11 +1758,11 @@ msgid "" "by Stefan Behnel in :issue:`36676` and :issue:`36673`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1443 +#: ../../whatsnew/3.8.rst:1444 msgid "xmlrpc" msgstr "xmlrpc" -#: ../../whatsnew/3.8.rst:1445 +#: ../../whatsnew/3.8.rst:1446 msgid "" ":class:`xmlrpc.client.ServerProxy` now supports an optional *headers* " "keyword argument for a sequence of HTTP headers to be sent with each " @@ -1770,36 +1771,36 @@ msgid "" "Cédric Krier in :issue:`35153`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1453 +#: ../../whatsnew/3.8.rst:1454 msgid "Optimizations" msgstr "" -#: ../../whatsnew/3.8.rst:1455 +#: ../../whatsnew/3.8.rst:1456 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:1459 +#: ../../whatsnew/3.8.rst:1460 msgid "*close_fds* is false;" msgstr "" -#: ../../whatsnew/3.8.rst:1460 +#: ../../whatsnew/3.8.rst:1461 msgid "" "*preexec_fn*, *pass_fds*, *cwd* and *start_new_session* parameters are not " "set;" msgstr "" -#: ../../whatsnew/3.8.rst:1462 +#: ../../whatsnew/3.8.rst:1463 msgid "the *executable* path contains a directory." msgstr "" -#: ../../whatsnew/3.8.rst:1464 +#: ../../whatsnew/3.8.rst:1465 msgid "(Contributed by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1466 +#: ../../whatsnew/3.8.rst:1467 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" @@ -1815,7 +1816,7 @@ msgid "" "Rodolà in :issue:`33671`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1482 +#: ../../whatsnew/3.8.rst:1483 msgid "" ":func:`shutil.copytree` uses :func:`os.scandir` function and all copy " "functions depending from it use cached :func:`os.stat` values. The speedup " @@ -1825,27 +1826,27 @@ msgid "" "on network filesystems. (Contributed by Giampaolo Rodolà in :issue:`33695`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1489 +#: ../../whatsnew/3.8.rst:1490 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:1493 +#: ../../whatsnew/3.8.rst:1494 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:1497 +#: ../../whatsnew/3.8.rst:1498 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:1500 +#: ../../whatsnew/3.8.rst:1501 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-" @@ -1853,7 +1854,7 @@ msgid "" "standard library). (Contributed by Raymond Hettinger in :issue:`35664`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1506 +#: ../../whatsnew/3.8.rst:1507 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 " @@ -1861,7 +1862,7 @@ msgid "" "Jevnik, Serhiy Storchaka in :issue:`32492`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1511 +#: ../../whatsnew/3.8.rst:1512 msgid "" "The :class:`list` constructor does not overallocate the internal item buffer " "if the input iterable has a known length (the input implements ``__len__``). " @@ -1869,7 +1870,7 @@ msgid "" "Hettinger and Pablo Galindo in :issue:`33234`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1516 +#: ../../whatsnew/3.8.rst:1517 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 " @@ -1877,7 +1878,7 @@ msgid "" "and Serhiy Storchaka in :issue:`36012`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1521 +#: ../../whatsnew/3.8.rst:1522 msgid "" "Reduced an overhead of converting arguments passed to many builtin functions " "and methods. This sped up calling some simple builtin functions and methods " @@ -1885,18 +1886,18 @@ msgid "" "`35582` and :issue:`36127`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1526 +#: ../../whatsnew/3.8.rst:1527 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:1532 +#: ../../whatsnew/3.8.rst:1533 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/3.8.rst:1534 +#: ../../whatsnew/3.8.rst:1535 msgid "" "Default :data:`sys.abiflags` became an empty string: the ``m`` flag for " "pymalloc became useless (builds with and without pymalloc are ABI " @@ -1904,22 +1905,22 @@ msgid "" "issue:`36707`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1538 +#: ../../whatsnew/3.8.rst:1539 msgid "Example of changes:" msgstr "" -#: ../../whatsnew/3.8.rst:1540 +#: ../../whatsnew/3.8.rst:1541 msgid "" "Only ``python3.8`` program is installed, ``python3.8m`` program is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1541 +#: ../../whatsnew/3.8.rst:1542 msgid "" "Only ``python3.8-config`` script is installed, ``python3.8m-config`` script " "is gone." msgstr "" -#: ../../whatsnew/3.8.rst:1543 +#: ../../whatsnew/3.8.rst:1544 msgid "" "The ``m`` flag has been removed from the suffix of dynamic library " "filenames: extension modules in the standard library as well as those " @@ -1928,23 +1929,23 @@ msgid "" "linux-gnu.so`` became ``.cpython-38-x86_64-linux-gnu.so`` in Python 3.8." msgstr "" -#: ../../whatsnew/3.8.rst:1550 +#: ../../whatsnew/3.8.rst:1551 msgid "" "The header files have been reorganized to better separate the different " "kinds of APIs:" msgstr "" -#: ../../whatsnew/3.8.rst:1553 +#: ../../whatsnew/3.8.rst:1554 msgid "``Include/*.h`` should be the portable public stable C API." msgstr "" -#: ../../whatsnew/3.8.rst:1554 +#: ../../whatsnew/3.8.rst:1555 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:1556 +#: ../../whatsnew/3.8.rst:1557 msgid "" "``Include/internal/*.h`` is the private internal C API very specific to " "CPython. This API comes with no backward compatibility warranty and should " @@ -1953,42 +1954,42 @@ msgid "" "calling functions. This API is now installed by ``make install``." msgstr "" -#: ../../whatsnew/3.8.rst:1562 +#: ../../whatsnew/3.8.rst:1563 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:1565 +#: ../../whatsnew/3.8.rst:1566 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:1569 +#: ../../whatsnew/3.8.rst:1570 msgid ":c:func:`Py_INCREF`, :c:func:`Py_DECREF`" msgstr ":c:func:`Py_INCREF`, :c:func:`Py_DECREF`" -#: ../../whatsnew/3.8.rst:1570 +#: ../../whatsnew/3.8.rst:1571 msgid ":c:func:`Py_XINCREF`, :c:func:`Py_XDECREF`" msgstr ":c:func:`Py_XINCREF`, :c:func:`Py_XDECREF`" -#: ../../whatsnew/3.8.rst:1571 +#: ../../whatsnew/3.8.rst:1572 msgid ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" msgstr ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" -#: ../../whatsnew/3.8.rst:1572 +#: ../../whatsnew/3.8.rst:1573 msgid "" "Private functions: :c:func:`_PyObject_GC_TRACK`, :c:func:" "`_PyObject_GC_UNTRACK`, :c:func:`_Py_Dealloc`" msgstr "" -#: ../../whatsnew/3.8.rst:1575 +#: ../../whatsnew/3.8.rst:1576 msgid "(Contributed by Victor Stinner in :issue:`35059`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1577 +#: ../../whatsnew/3.8.rst:1578 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 " @@ -1996,14 +1997,14 @@ msgid "" "(Contributed by Victor Stinner in :issue:`35713`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1582 +#: ../../whatsnew/3.8.rst:1583 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:1586 +#: ../../whatsnew/3.8.rst:1587 msgid "" "The duality of ``Modules/Setup.dist`` and ``Modules/Setup`` has been " "removed. Previously, when updating the CPython source tree, one had to " @@ -2014,7 +2015,7 @@ msgid "" "the file could produce build failures." msgstr "" -#: ../../whatsnew/3.8.rst:1594 +#: ../../whatsnew/3.8.rst:1595 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 " @@ -2022,11 +2023,11 @@ msgid "" "for any other change to the source tree." msgstr "" -#: ../../whatsnew/3.8.rst:1599 +#: ../../whatsnew/3.8.rst:1600 msgid "(Contributed by Antoine Pitrou in :issue:`32430`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1601 +#: ../../whatsnew/3.8.rst:1602 msgid "" "Functions that convert Python number to C integer like :c:func:" "`PyLong_AsLong` and argument parsing functions like :c:func:" @@ -2042,7 +2043,7 @@ msgid "" "`20092`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1615 +#: ../../whatsnew/3.8.rst:1616 msgid "" "Heap-allocated type objects will now increase their reference count in :c:" "func:`PyObject_Init` (and its parallel macro ``PyObject_INIT``) instead of " @@ -2051,7 +2052,7 @@ msgid "" "issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1621 +#: ../../whatsnew/3.8.rst:1622 msgid "" "The new function :c:func:`PyCode_NewWithPosOnlyArgs` allows to create code " "objects like :c:func:`PyCode_New`, but with an extra *posonlyargcount* " @@ -2059,25 +2060,25 @@ msgid "" "(Contributed by Pablo Galindo in :issue:`37221`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1626 +#: ../../whatsnew/3.8.rst:1627 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:1633 +#: ../../whatsnew/3.8.rst:1634 msgid "Deprecated" msgstr "" -#: ../../whatsnew/3.8.rst:1635 +#: ../../whatsnew/3.8.rst:1636 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:1639 +#: ../../whatsnew/3.8.rst:1640 msgid "" "Deprecated methods ``getchildren()`` and ``getiterator()`` in the :mod:`~xml." "etree.ElementTree` module now emit a :exc:`DeprecationWarning` instead of :" @@ -2085,7 +2086,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1645 +#: ../../whatsnew/3.8.rst:1646 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:1746 +#: ../../whatsnew/3.8.rst:1747 msgid "API and Feature Removals" msgstr "" -#: ../../whatsnew/3.8.rst:1748 +#: ../../whatsnew/3.8.rst:1749 msgid "The following features and APIs have been removed from Python 3.8:" msgstr "" -#: ../../whatsnew/3.8.rst:1750 +#: ../../whatsnew/3.8.rst:1751 msgid "" "Starting with Python 3.3, importing ABCs from :mod:`collections` was " "deprecated, and importing should be done from :mod:`collections.abc`. Being " @@ -2256,20 +2257,20 @@ msgid "" "delayed to 3.9. (See :issue:`36952`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1755 +#: ../../whatsnew/3.8.rst:1756 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:1758 ../../whatsnew/3.8.rst:1877 +#: ../../whatsnew/3.8.rst:1759 ../../whatsnew/3.8.rst:1878 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:1762 +#: ../../whatsnew/3.8.rst:1763 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." @@ -2277,27 +2278,27 @@ msgid "" "behavior. (Contributed by Matthias Bussonnier in :issue:`36895`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1768 +#: ../../whatsnew/3.8.rst:1769 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:1772 +#: ../../whatsnew/3.8.rst:1773 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:1776 +#: ../../whatsnew/3.8.rst:1777 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:1779 +#: ../../whatsnew/3.8.rst:1780 msgid "" "The :class:`~xml.etree.ElementTree.XMLParser` constructor no longer accepts " "the *html* argument. It never had an effect and was deprecated in Python " @@ -2305,53 +2306,53 @@ msgid "" "only_parameter>`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1784 +#: ../../whatsnew/3.8.rst:1785 msgid "" "Removed the ``doctype()`` method of :class:`~xml.etree.ElementTree." "XMLParser`. (Contributed by Serhiy Storchaka in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1787 +#: ../../whatsnew/3.8.rst:1788 msgid "" "\"unicode_internal\" codec is removed. (Contributed by Inada Naoki in :issue:" "`36297`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1790 +#: ../../whatsnew/3.8.rst:1791 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:1794 +#: ../../whatsnew/3.8.rst:1795 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:1798 +#: ../../whatsnew/3.8.rst:1799 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:1804 +#: ../../whatsnew/3.8.rst:1805 msgid "Porting to Python 3.8" msgstr "" -#: ../../whatsnew/3.8.rst:1806 +#: ../../whatsnew/3.8.rst:1807 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.8.rst:1811 +#: ../../whatsnew/3.8.rst:1812 msgid "Changes in Python behavior" msgstr "" -#: ../../whatsnew/3.8.rst:1813 +#: ../../whatsnew/3.8.rst:1814 msgid "" "Yield expressions (both ``yield`` and ``yield from`` clauses) are now " "disallowed in comprehensions and generator expressions (aside from the " @@ -2359,7 +2360,7 @@ msgid "" "Serhiy Storchaka in :issue:`10544`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1818 +#: ../../whatsnew/3.8.rst:1819 msgid "" "The compiler now produces a :exc:`SyntaxWarning` when identity checks " "(``is`` and ``is not``) are used with certain types of literals (e.g. " @@ -2369,7 +2370,7 @@ msgid "" "issue:`34850`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1825 +#: ../../whatsnew/3.8.rst:1826 msgid "" "The CPython interpreter can swallow exceptions in some circumstances. In " "Python 3.8 this happens in fewer cases. In particular, exceptions raised " @@ -2377,7 +2378,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`35459`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1830 +#: ../../whatsnew/3.8.rst:1831 msgid "" "Removed ``__str__`` implementations from builtin types :class:`bool`, :class:" "`int`, :class:`float`, :class:`complex` and few classes from the standard " @@ -2387,7 +2388,7 @@ msgid "" "issue:`36793`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1837 +#: ../../whatsnew/3.8.rst:1838 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since older " @@ -2396,7 +2397,7 @@ msgid "" "`36588`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1843 +#: ../../whatsnew/3.8.rst:1844 msgid "" ":c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` now " "terminate the current thread if called while the interpreter is finalizing, " @@ -2407,11 +2408,11 @@ msgid "" "`36475`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1853 +#: ../../whatsnew/3.8.rst:1854 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.8.rst:1855 +#: ../../whatsnew/3.8.rst:1856 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 " @@ -2419,7 +2420,7 @@ msgid "" "in :issue:`37412`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1860 +#: ../../whatsnew/3.8.rst:1861 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 " @@ -2429,7 +2430,7 @@ msgid "" "by Joannah Nanjekye and Victor Stinner in :issue:`35537`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1867 +#: ../../whatsnew/3.8.rst:1868 msgid "" "The *preexec_fn* argument of * :class:`subprocess.Popen` is no longer " "compatible with subinterpreters. The use of the parameter in a " @@ -2437,20 +2438,20 @@ msgid "" "issue:`34651`, modified by Christian Heimes in :issue:`37951`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1873 +#: ../../whatsnew/3.8.rst:1874 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:1881 +#: ../../whatsnew/3.8.rst:1882 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:1886 +#: ../../whatsnew/3.8.rst:1887 msgid "" "The :meth:`~tkinter.ttk.Treeview.selection` method of the :class:`tkinter." "ttk.Treeview` class no longer takes arguments. Using it with arguments for " @@ -2459,7 +2460,7 @@ msgid "" "selection. (Contributed by Serhiy Storchaka in :issue:`31508`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1892 +#: ../../whatsnew/3.8.rst:1893 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 " @@ -2467,14 +2468,14 @@ msgid "" "Rojas and Raymond Hettinger in :issue:`34160`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1897 +#: ../../whatsnew/3.8.rst:1898 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:1902 +#: ../../whatsnew/3.8.rst:1903 msgid "" "The ``doctype()`` method defined in a subclass of :class:`~xml.etree." "ElementTree.XMLParser` will no longer be called and will emit a :exc:" @@ -2484,7 +2485,7 @@ msgid "" "in :issue:`29209`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1909 +#: ../../whatsnew/3.8.rst:1910 msgid "" "A :exc:`RuntimeError` is now raised when the custom metaclass doesn't " "provide the ``__classcell__`` entry in the namespace passed to ``type." @@ -2492,13 +2493,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`23722`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1914 +#: ../../whatsnew/3.8.rst:1915 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:1917 +#: ../../whatsnew/3.8.rst:1918 msgid "" ":func:`shutil.copyfile`, :func:`shutil.copy`, :func:`shutil.copy2`, :func:" "`shutil.copytree` and :func:`shutil.move` use platform-specific \"fast-copy" @@ -2506,19 +2507,19 @@ msgid "" "section)." msgstr "" -#: ../../whatsnew/3.8.rst:1922 +#: ../../whatsnew/3.8.rst:1923 msgid "" ":func:`shutil.copyfile` default buffer size on Windows was changed from 16 " "KiB to 1 MiB." msgstr "" -#: ../../whatsnew/3.8.rst:1925 +#: ../../whatsnew/3.8.rst:1926 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:1928 +#: ../../whatsnew/3.8.rst:1929 msgid "" "The :c:type:`PyInterpreterState` struct has been moved into the \"internal\" " "header files (specifically Include/internal/pycore_pystate.h). An opaque " @@ -2530,7 +2531,7 @@ msgid "" "functions to the public API). (See :issue:`35886`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1938 +#: ../../whatsnew/3.8.rst:1939 msgid "" "The :meth:`mmap.flush() ` method now returns ``None`` on " "success and raises an exception on error under all platforms. Previously, " @@ -2540,13 +2541,13 @@ msgid "" "(Contributed by Berker Peksag in :issue:`2122`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1945 +#: ../../whatsnew/3.8.rst:1946 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:1949 +#: ../../whatsnew/3.8.rst:1950 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`, :" @@ -2554,7 +2555,7 @@ msgid "" "(Contributed by Xiang Zhang in :issue:`33106`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1954 +#: ../../whatsnew/3.8.rst:1955 msgid "" "Simplified AST for literals. All constants will be represented as :class:" "`ast.Constant` instances. Instantiating old classes ``Num``, ``Str``, " @@ -2562,7 +2563,7 @@ msgid "" "``Constant``. (Contributed by Serhiy Storchaka in :issue:`32892`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1970 +#: ../../whatsnew/3.8.rst:1971 msgid "" "The function :func:`asyncio.wait_for` now correctly waits for cancellation " "when using an instance of :class:`asyncio.Task`. Previously, upon reaching " @@ -2570,18 +2571,18 @@ msgid "" "Pranskevichus in :issue:`32751`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1975 +#: ../../whatsnew/3.8.rst:1976 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:1979 +#: ../../whatsnew/3.8.rst:1980 msgid ":class:`asyncio.BufferedProtocol` has graduated to the stable API." msgstr "" -#: ../../whatsnew/3.8.rst:1983 +#: ../../whatsnew/3.8.rst:1984 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 " @@ -2596,14 +2597,14 @@ msgid "" "verified by the installer). (Contributed by Steve Dower in :issue:`36085`.)" msgstr "" -#: ../../whatsnew/3.8.rst:1996 +#: ../../whatsnew/3.8.rst:1997 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:2000 +#: ../../whatsnew/3.8.rst:2001 msgid "" ":class:`types.CodeType` has a new parameter in the second position of the " "constructor (*posonlyargcount*) to support positional-only arguments defined " @@ -2613,11 +2614,11 @@ msgid "" "code future-proof." msgstr "" -#: ../../whatsnew/3.8.rst:2009 +#: ../../whatsnew/3.8.rst:2010 msgid "Changes in the C API" msgstr "" -#: ../../whatsnew/3.8.rst:2011 +#: ../../whatsnew/3.8.rst:2012 msgid "" "The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version* " "field. It should be initialized to ``PY_MINOR_VERSION``. The field is " @@ -2625,14 +2626,14 @@ msgid "" "in *cf_flags*. (Contributed by Guido van Rossum in :issue:`35766`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2017 +#: ../../whatsnew/3.8.rst:2018 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:2022 +#: ../../whatsnew/3.8.rst:2023 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 " @@ -2643,7 +2644,7 @@ msgid "" "Stinner in :issue:`21536`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2030 +#: ../../whatsnew/3.8.rst:2031 msgid "" "Use of ``#`` variants of formats in parsing or building value (e.g. :c:func:" "`PyArg_ParseTuple`, :c:func:`Py_BuildValue`, :c:func:" @@ -2652,7 +2653,7 @@ msgid "" "`arg-parsing` for detail. (Contributed by Inada Naoki in :issue:`36381`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2036 +#: ../../whatsnew/3.8.rst:2037 msgid "" "Instances of heap-allocated types (such as those created with :c:func:" "`PyType_FromSpec`) hold a reference to their type object. Increasing the " @@ -2662,11 +2663,11 @@ msgid "" "through :c:func:`PyType_FromSpec` behave like other classes in managed code." msgstr "" -#: ../../whatsnew/3.8.rst:2044 +#: ../../whatsnew/3.8.rst:2045 msgid ":ref:`Statically allocated types ` are not affected." msgstr "" -#: ../../whatsnew/3.8.rst:2046 +#: ../../whatsnew/3.8.rst:2047 msgid "" "For the vast majority of cases, there should be no side effect. However, " "types that manually increase the reference count after allocating an " @@ -2675,12 +2676,12 @@ msgid "" "instance deallocation." msgstr "" -#: ../../whatsnew/3.8.rst:2052 +#: ../../whatsnew/3.8.rst:2053 msgid "" "To correctly port these types into 3.8, please apply the following changes:" msgstr "" -#: ../../whatsnew/3.8.rst:2055 +#: ../../whatsnew/3.8.rst:2056 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:" @@ -2689,32 +2690,32 @@ msgid "" "`PyObject_INIT`." msgstr "" -#: ../../whatsnew/3.8.rst:2062 ../../whatsnew/3.8.rst:2081 -#: ../../whatsnew/3.8.rst:2100 +#: ../../whatsnew/3.8.rst:2063 ../../whatsnew/3.8.rst:2082 +#: ../../whatsnew/3.8.rst:2101 msgid "Example:" msgstr "範例:" -#: ../../whatsnew/3.8.rst:2078 +#: ../../whatsnew/3.8.rst:2079 msgid "" "Ensure that all custom ``tp_dealloc`` functions of heap-allocated types " "decrease the type's reference count." msgstr "" -#: ../../whatsnew/3.8.rst:2095 +#: ../../whatsnew/3.8.rst:2096 msgid "(Contributed by Eddie Elizondo in :issue:`35810`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2097 +#: ../../whatsnew/3.8.rst:2098 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:2106 +#: ../../whatsnew/3.8.rst:2107 msgid "(Contributed by Zackery Spytz in :issue:`33407`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2108 +#: ../../whatsnew/3.8.rst:2109 msgid "" "The interpreter does not pretend to support binary compatibility of " "extension types across feature releases, anymore. A :c:type:`PyTypeObject` " @@ -2724,17 +2725,17 @@ msgid "" "before reading :c:member:`~PyTypeObject.tp_finalize`)." msgstr "" -#: ../../whatsnew/3.8.rst:2115 +#: ../../whatsnew/3.8.rst:2116 msgid "(Contributed by Antoine Pitrou in :issue:`32388`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2117 +#: ../../whatsnew/3.8.rst:2118 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:2120 +#: ../../whatsnew/3.8.rst:2121 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 " @@ -2743,7 +2744,7 @@ msgid "" "package:" msgstr "" -#: ../../whatsnew/3.8.rst:2130 +#: ../../whatsnew/3.8.rst:2131 msgid "" "The location of an installed :file:`pythonXY.dll` will depend on the " "installation options and the version and language of Windows. See :ref:" @@ -2752,15 +2753,15 @@ msgid "" "the :file:`libs` directory under your Python installation." msgstr "" -#: ../../whatsnew/3.8.rst:2136 +#: ../../whatsnew/3.8.rst:2137 msgid "(Contributed by Steve Dower in :issue:`37351`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2140 +#: ../../whatsnew/3.8.rst:2141 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.8.rst:2142 +#: ../../whatsnew/3.8.rst:2143 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 " @@ -2768,7 +2769,7 @@ msgid "" "code for :keyword:`break`, :keyword:`continue` and :keyword:`return`." msgstr "" -#: ../../whatsnew/3.8.rst:2148 +#: ../../whatsnew/3.8.rst:2149 msgid "" "Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`, :opcode:" "`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes :opcode:" @@ -2777,20 +2778,20 @@ msgid "" "`WITH_CLEANUP_START`." msgstr "" -#: ../../whatsnew/3.8.rst:2154 +#: ../../whatsnew/3.8.rst:2155 msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2157 +#: ../../whatsnew/3.8.rst:2158 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:2161 +#: ../../whatsnew/3.8.rst:2162 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 " @@ -2798,22 +2799,22 @@ msgid "" "by :pep:`572`. (Contributed by Jörn Heissler in :issue:`35224`.)" msgstr "" -#: ../../whatsnew/3.8.rst:2168 +#: ../../whatsnew/3.8.rst:2169 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.8.rst:2170 +#: ../../whatsnew/3.8.rst:2171 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:2174 +#: ../../whatsnew/3.8.rst:2175 msgid "Here's a summary of performance improvements since Python 3.3:" msgstr "" -#: ../../whatsnew/3.8.rst:2221 +#: ../../whatsnew/3.8.rst:2222 msgid "" "The benchmarks were measured on an `Intel® Core™ i7-4960HQ processor " "\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,7 +49,7 @@ msgstr "Łukasz Langa" #: ../../whatsnew/3.9.rst:47 msgid "" "This article explains the new features in Python 3.9, compared to 3.8. " -"Python 3.9 was released on October 5th, 2020." +"Python 3.9 was released on October 5, 2020." msgstr "" #: ../../whatsnew/3.9.rst:50