diff --git a/bugs.po b/bugs.po index 9462a48f44..a3245d3784 100644 --- a/bugs.po +++ b/bugs.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-07 00:17+0000\n" +"POT-Creation-Date: 2023-02-27 00:17+0000\n" "PO-Revision-Date: 2022-08-31 12:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,8 +68,8 @@ msgid "" "You can also open a discussion item on our `Documentation Discourse forum " "`_." msgstr "" -"你也可以在我們的\\ `說明文件 Discourse 討論區 `_\\ " -"中新增一個討論事項。" +"你也可以在我們的\\ `說明文件 Discourse 討論區 `_\\ 中新增一個討論事項。" #: ../../bugs.rst:25 msgid "" @@ -184,7 +184,7 @@ msgstr "提交的表單中有兩個欄位,「Title」及「Comment」。" #: ../../bugs.rst:72 msgid "" "For the \"Title\" field, enter a *very* short description of the problem; " -"less than ten words is good." +"fewer than ten words is good." msgstr "" "在「Title」欄位,輸入對該問題\\ *非常*\\ 簡短的描述;最好少於十個單字。" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 9f10861ecc..4506cc1381 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-02-27 00:17+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-" @@ -1358,7 +1358,7 @@ msgid "" "additional contextual information to be added to the log). So you cannot " "directly make logging calls using :meth:`str.format` or :class:`string." "Template` syntax, because internally the logging package uses %-formatting " -"to merge the format string and the variable arguments. There would no " +"to merge the format string and the variable arguments. There would be no " "changing this while preserving backward compatibility, since all logging " "calls which are out there in existing code will be using %-format strings." msgstr "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 2d83b9cd37..a93adcd8ae 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-02-26 00:19+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -256,15 +256,14 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:179 -#: ../../library/asyncio-eventloop.rst:199 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr "" #: ../../library/asyncio-eventloop.rst:182 -#: ../../library/asyncio-eventloop.rst:1212 -#: ../../library/asyncio-eventloop.rst:1600 +#: ../../library/asyncio-eventloop.rst:1216 +#: ../../library/asyncio-eventloop.rst:1604 msgid "Example::" msgstr "" "範例:\n" @@ -274,212 +273,225 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:194 msgid "" "Schedule the closure of the default executor and wait for it to join all of " -"the threads in the :class:`ThreadPoolExecutor`. After calling this method, " -"a :exc:`RuntimeError` will be raised if :meth:`loop.run_in_executor` is " -"called while using the default executor." +"the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " +"this method has been called, using the default executor with :meth:`loop." +"run_in_executor` will raise a :exc:`RuntimeError`." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:202 +msgid "" +"Do not call this method when using :func:`asyncio.run`, as the latter " +"handles default executor shutdown automatically." msgstr "" -#: ../../library/asyncio-eventloop.rst:206 +#: ../../library/asyncio-eventloop.rst:209 msgid "Scheduling callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:210 +#: ../../library/asyncio-eventloop.rst:213 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:213 +#: ../../library/asyncio-eventloop.rst:216 msgid "" -"Callbacks are called in the order in which they are registered. Each " -"callback will be called exactly once." +"Return an instance of :class:`asyncio.Handle`, which can be used later to " +"cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:216 -#: ../../library/asyncio-eventloop.rst:283 +#: ../../library/asyncio-eventloop.rst:219 msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *callback* to run in. The current " -"context is used when no *context* is provided." +"Callbacks are called in the order in which they are registered. Each " +"callback will be called exactly once." msgstr "" -#: ../../library/asyncio-eventloop.rst:220 +#: ../../library/asyncio-eventloop.rst:222 msgid "" -"An instance of :class:`asyncio.Handle` is returned, which can be used later " -"to cancel the callback." +"The optional keyword-only *context* argument specifies a custom :class:" +"`contextvars.Context` for the *callback* to run in. Callbacks use the " +"current context when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:223 -msgid "This method is not thread-safe." +#: ../../library/asyncio-eventloop.rst:226 +msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:227 +#: ../../library/asyncio-eventloop.rst:230 msgid "" -"A thread-safe variant of :meth:`call_soon`. Must be used to schedule " -"callbacks *from another thread*." +"A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from " +"another thread, this function *must* be used, since :meth:`call_soon` is not " +"thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:230 +#: ../../library/asyncio-eventloop.rst:234 msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." msgstr "" -#: ../../library/asyncio-eventloop.rst:234 +#: ../../library/asyncio-eventloop.rst:238 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-eventloop.rst:237 -#: ../../library/asyncio-eventloop.rst:287 -#: ../../library/asyncio-eventloop.rst:307 +#: ../../library/asyncio-eventloop.rst:241 +#: ../../library/asyncio-eventloop.rst:291 +#: ../../library/asyncio-eventloop.rst:311 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:245 +#: ../../library/asyncio-eventloop.rst:249 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" msgstr "" -#: ../../library/asyncio-eventloop.rst:252 +#: ../../library/asyncio-eventloop.rst:256 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:260 +#: ../../library/asyncio-eventloop.rst:264 msgid "Scheduling delayed callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:262 +#: ../../library/asyncio-eventloop.rst:266 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." msgstr "" -#: ../../library/asyncio-eventloop.rst:269 +#: ../../library/asyncio-eventloop.rst:273 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "" -#: ../../library/asyncio-eventloop.rst:272 -#: ../../library/asyncio-eventloop.rst:304 +#: ../../library/asyncio-eventloop.rst:276 +#: ../../library/asyncio-eventloop.rst:308 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:275 +#: ../../library/asyncio-eventloop.rst:279 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." msgstr "" -#: ../../library/asyncio-eventloop.rst:279 +#: ../../library/asyncio-eventloop.rst:283 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" "func:`functools.partial`." msgstr "" -#: ../../library/asyncio-eventloop.rst:291 +#: ../../library/asyncio-eventloop.rst:287 +msgid "" +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:295 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:298 +#: ../../library/asyncio-eventloop.rst:302 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:302 +#: ../../library/asyncio-eventloop.rst:306 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "" -#: ../../library/asyncio-eventloop.rst:311 +#: ../../library/asyncio-eventloop.rst:315 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " "This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:318 +#: ../../library/asyncio-eventloop.rst:322 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "" -#: ../../library/asyncio-eventloop.rst:322 +#: ../../library/asyncio-eventloop.rst:326 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:328 +#: ../../library/asyncio-eventloop.rst:332 msgid "The :func:`asyncio.sleep` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:332 +#: ../../library/asyncio-eventloop.rst:336 msgid "Creating Futures and Tasks" msgstr "" -#: ../../library/asyncio-eventloop.rst:336 +#: ../../library/asyncio-eventloop.rst:340 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:338 +#: ../../library/asyncio-eventloop.rst:342 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " "(with better performance or instrumentation)." msgstr "" -#: ../../library/asyncio-eventloop.rst:346 +#: ../../library/asyncio-eventloop.rst:350 msgid "" "Schedule the execution of :ref:`coroutine ` *coro*. Return a :" "class:`Task` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:349 +#: ../../library/asyncio-eventloop.rst:353 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" "`Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:353 +#: ../../library/asyncio-eventloop.rst:357 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -#: ../../library/asyncio-eventloop.rst:356 +#: ../../library/asyncio-eventloop.rst:360 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " "copy is created when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:360 +#: ../../library/asyncio-eventloop.rst:364 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:363 +#: ../../library/asyncio-eventloop.rst:367 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:368 +#: ../../library/asyncio-eventloop.rst:372 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:371 +#: ../../library/asyncio-eventloop.rst:375 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " @@ -488,82 +500,82 @@ msgid "" "Future`-compatible object." msgstr "" -#: ../../library/asyncio-eventloop.rst:379 +#: ../../library/asyncio-eventloop.rst:383 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" -#: ../../library/asyncio-eventloop.rst:383 +#: ../../library/asyncio-eventloop.rst:387 msgid "Opening network connections" msgstr "" -#: ../../library/asyncio-eventloop.rst:393 +#: ../../library/asyncio-eventloop.rst:397 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:396 +#: ../../library/asyncio-eventloop.rst:400 msgid "" "The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:400 +#: ../../library/asyncio-eventloop.rst:404 msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:402 -#: ../../library/asyncio-eventloop.rst:1128 -#: ../../library/asyncio-eventloop.rst:1144 +#: ../../library/asyncio-eventloop.rst:406 +#: ../../library/asyncio-eventloop.rst:1132 +#: ../../library/asyncio-eventloop.rst:1148 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:405 +#: ../../library/asyncio-eventloop.rst:409 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:408 +#: ../../library/asyncio-eventloop.rst:412 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:414 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "" -#: ../../library/asyncio-eventloop.rst:413 +#: ../../library/asyncio-eventloop.rst:417 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:416 +#: ../../library/asyncio-eventloop.rst:420 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:419 +#: ../../library/asyncio-eventloop.rst:423 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:421 +#: ../../library/asyncio-eventloop.rst:425 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "" -#: ../../library/asyncio-eventloop.rst:424 -#: ../../library/asyncio-eventloop.rst:545 +#: ../../library/asyncio-eventloop.rst:428 +#: ../../library/asyncio-eventloop.rst:549 msgid "Other arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:426 +#: ../../library/asyncio-eventloop.rst:430 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -572,11 +584,11 @@ msgid "" "is used." msgstr "" -#: ../../library/asyncio-eventloop.rst:432 +#: ../../library/asyncio-eventloop.rst:436 msgid ":ref:`SSL/TLS security considerations `" msgstr "" -#: ../../library/asyncio-eventloop.rst:434 +#: ../../library/asyncio-eventloop.rst:438 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -587,7 +599,7 @@ msgid "" "potential man-in-the-middle attacks)." msgstr "" -#: ../../library/asyncio-eventloop.rst:442 +#: ../../library/asyncio-eventloop.rst:446 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -595,7 +607,7 @@ msgid "" "constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:447 +#: ../../library/asyncio-eventloop.rst:451 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -605,7 +617,7 @@ msgid "" "the RFC is ``0.25`` (250 milliseconds)." msgstr "" -#: ../../library/asyncio-eventloop.rst:455 +#: ../../library/asyncio-eventloop.rst:459 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -616,7 +628,7 @@ msgid "" "*happy_eyeballs_delay* is not specified, and ``1`` if it is." msgstr "" -#: ../../library/asyncio-eventloop.rst:464 +#: ../../library/asyncio-eventloop.rst:468 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -624,134 +636,134 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:472 -#: ../../library/asyncio-eventloop.rst:576 -#: ../../library/asyncio-eventloop.rst:800 +#: ../../library/asyncio-eventloop.rst:476 +#: ../../library/asyncio-eventloop.rst:580 +#: ../../library/asyncio-eventloop.rst:804 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." "BaseTransport.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:476 +#: ../../library/asyncio-eventloop.rst:480 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " "``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:480 -#: ../../library/asyncio-eventloop.rst:891 +#: ../../library/asyncio-eventloop.rst:484 +#: ../../library/asyncio-eventloop.rst:895 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:484 -#: ../../library/asyncio-eventloop.rst:717 -#: ../../library/asyncio-eventloop.rst:811 -#: ../../library/asyncio-eventloop.rst:895 +#: ../../library/asyncio-eventloop.rst:488 +#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:899 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:494 +#: ../../library/asyncio-eventloop.rst:733 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:494 +#: ../../library/asyncio-eventloop.rst:498 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:499 -#: ../../library/asyncio-eventloop.rst:821 +#: ../../library/asyncio-eventloop.rst:503 +#: ../../library/asyncio-eventloop.rst:825 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:503 +#: ../../library/asyncio-eventloop.rst:507 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:505 +#: ../../library/asyncio-eventloop.rst:509 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " "are not working, a dual-stack client application experiences significant " "connection delay compared to an IPv4-only client. This is undesirable " -"because it causes the dual- stack client to have a worse user experience. " +"because it causes the dual-stack client to have a worse user experience. " "This document specifies requirements for algorithms that reduce this user-" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:514 +#: ../../library/asyncio-eventloop.rst:518 msgid "For more information: https://tools.ietf.org/html/rfc6555" msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:518 -#: ../../library/asyncio-eventloop.rst:637 -#: ../../library/asyncio-eventloop.rst:743 -#: ../../library/asyncio-eventloop.rst:778 -#: ../../library/asyncio-eventloop.rst:825 -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:522 +#: ../../library/asyncio-eventloop.rst:641 +#: ../../library/asyncio-eventloop.rst:747 +#: ../../library/asyncio-eventloop.rst:782 +#: ../../library/asyncio-eventloop.rst:829 +#: ../../library/asyncio-eventloop.rst:907 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:522 +#: ../../library/asyncio-eventloop.rst:526 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:532 +#: ../../library/asyncio-eventloop.rst:536 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:534 +#: ../../library/asyncio-eventloop.rst:538 msgid "" "The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" "`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:538 +#: ../../library/asyncio-eventloop.rst:542 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:540 -#: ../../library/asyncio-eventloop.rst:660 -#: ../../library/asyncio-eventloop.rst:792 +#: ../../library/asyncio-eventloop.rst:544 +#: ../../library/asyncio-eventloop.rst:664 +#: ../../library/asyncio-eventloop.rst:796 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:543 -#: ../../library/asyncio-eventloop.rst:619 +#: ../../library/asyncio-eventloop.rst:547 +#: ../../library/asyncio-eventloop.rst:623 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:547 +#: ../../library/asyncio-eventloop.rst:551 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using :" "meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:551 +#: ../../library/asyncio-eventloop.rst:555 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:555 +#: ../../library/asyncio-eventloop.rst:559 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -759,7 +771,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:560 +#: ../../library/asyncio-eventloop.rst:564 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -768,13 +780,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:566 +#: ../../library/asyncio-eventloop.rst:570 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:569 +#: ../../library/asyncio-eventloop.rst:573 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -782,33 +794,33 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:580 +#: ../../library/asyncio-eventloop.rst:584 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:583 +#: ../../library/asyncio-eventloop.rst:587 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:587 +#: ../../library/asyncio-eventloop.rst:591 msgid "" "The *reuse_address* parameter is no longer supported, as using :py:data:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:592 +#: ../../library/asyncio-eventloop.rst:596 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:596 +#: ../../library/asyncio-eventloop.rst:600 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " @@ -816,95 +828,95 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:602 +#: ../../library/asyncio-eventloop.rst:606 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:605 +#: ../../library/asyncio-eventloop.rst:609 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:614 +#: ../../library/asyncio-eventloop.rst:618 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:616 +#: ../../library/asyncio-eventloop.rst:620 msgid "" "The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" "py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:621 +#: ../../library/asyncio-eventloop.rst:625 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:626 +#: ../../library/asyncio-eventloop.rst:630 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:629 -#: ../../library/asyncio-eventloop.rst:769 -#: ../../library/asyncio-eventloop.rst:1195 +#: ../../library/asyncio-eventloop.rst:633 +#: ../../library/asyncio-eventloop.rst:773 +#: ../../library/asyncio-eventloop.rst:1199 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:631 +#: ../../library/asyncio-eventloop.rst:635 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:641 +#: ../../library/asyncio-eventloop.rst:645 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:653 +#: ../../library/asyncio-eventloop.rst:657 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:656 +#: ../../library/asyncio-eventloop.rst:660 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:658 +#: ../../library/asyncio-eventloop.rst:662 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:663 +#: ../../library/asyncio-eventloop.rst:667 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:666 +#: ../../library/asyncio-eventloop.rst:670 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:669 +#: ../../library/asyncio-eventloop.rst:673 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:672 +#: ../../library/asyncio-eventloop.rst:676 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:676 +#: ../../library/asyncio-eventloop.rst:680 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -912,63 +924,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:681 +#: ../../library/asyncio-eventloop.rst:685 msgid "" "*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:686 +#: ../../library/asyncio-eventloop.rst:690 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:688 +#: ../../library/asyncio-eventloop.rst:692 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:693 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:697 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:700 +#: ../../library/asyncio-eventloop.rst:704 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:703 +#: ../../library/asyncio-eventloop.rst:707 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:708 +#: ../../library/asyncio-eventloop.rst:712 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:713 +#: ../../library/asyncio-eventloop.rst:717 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:725 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -976,44 +988,44 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:733 +#: ../../library/asyncio-eventloop.rst:737 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:737 +#: ../../library/asyncio-eventloop.rst:741 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:747 +#: ../../library/asyncio-eventloop.rst:751 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:758 +#: ../../library/asyncio-eventloop.rst:762 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:761 +#: ../../library/asyncio-eventloop.rst:765 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:766 +#: ../../library/asyncio-eventloop.rst:770 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:773 +#: ../../library/asyncio-eventloop.rst:777 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1021,63 +1033,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:785 +#: ../../library/asyncio-eventloop.rst:789 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:787 +#: ../../library/asyncio-eventloop.rst:791 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:790 -#: ../../library/asyncio-eventloop.rst:877 +#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:881 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:795 +#: ../../library/asyncio-eventloop.rst:799 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:804 +#: ../../library/asyncio-eventloop.rst:808 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:807 +#: ../../library/asyncio-eventloop.rst:811 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:819 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:829 +#: ../../library/asyncio-eventloop.rst:833 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:834 +#: ../../library/asyncio-eventloop.rst:838 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:837 +#: ../../library/asyncio-eventloop.rst:841 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:839 +#: ../../library/asyncio-eventloop.rst:843 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:841 -#: ../../library/asyncio-eventloop.rst:1083 +#: ../../library/asyncio-eventloop.rst:845 +#: ../../library/asyncio-eventloop.rst:1087 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1086,35 +1098,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:848 +#: ../../library/asyncio-eventloop.rst:852 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:852 +#: ../../library/asyncio-eventloop.rst:856 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:859 +#: ../../library/asyncio-eventloop.rst:863 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:870 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:868 +#: ../../library/asyncio-eventloop.rst:872 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:872 +#: ../../library/asyncio-eventloop.rst:876 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1122,74 +1134,74 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:879 +#: ../../library/asyncio-eventloop.rst:883 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:883 +#: ../../library/asyncio-eventloop.rst:887 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:885 +#: ../../library/asyncio-eventloop.rst:889 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:888 +#: ../../library/asyncio-eventloop.rst:892 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:908 +#: ../../library/asyncio-eventloop.rst:912 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:918 +#: ../../library/asyncio-eventloop.rst:922 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:923 +#: ../../library/asyncio-eventloop.rst:927 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:927 -#: ../../library/asyncio-eventloop.rst:1182 +#: ../../library/asyncio-eventloop.rst:931 +#: ../../library/asyncio-eventloop.rst:1186 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:936 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:935 +#: ../../library/asyncio-eventloop.rst:939 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:940 +#: ../../library/asyncio-eventloop.rst:944 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:946 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1198,72 +1210,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:951 +#: ../../library/asyncio-eventloop.rst:955 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:954 +#: ../../library/asyncio-eventloop.rst:958 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 -#: ../../library/asyncio-eventloop.rst:970 -#: ../../library/asyncio-eventloop.rst:981 -#: ../../library/asyncio-eventloop.rst:993 -#: ../../library/asyncio-eventloop.rst:1008 -#: ../../library/asyncio-eventloop.rst:1023 -#: ../../library/asyncio-eventloop.rst:1033 -#: ../../library/asyncio-eventloop.rst:1059 -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:960 +#: ../../library/asyncio-eventloop.rst:974 +#: ../../library/asyncio-eventloop.rst:985 +#: ../../library/asyncio-eventloop.rst:997 +#: ../../library/asyncio-eventloop.rst:1012 +#: ../../library/asyncio-eventloop.rst:1027 +#: ../../library/asyncio-eventloop.rst:1037 +#: ../../library/asyncio-eventloop.rst:1063 +#: ../../library/asyncio-eventloop.rst:1101 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:958 +#: ../../library/asyncio-eventloop.rst:962 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:965 +#: ../../library/asyncio-eventloop.rst:969 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:968 +#: ../../library/asyncio-eventloop.rst:972 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:976 +#: ../../library/asyncio-eventloop.rst:980 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:979 +#: ../../library/asyncio-eventloop.rst:983 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:987 +#: ../../library/asyncio-eventloop.rst:991 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:991 +#: ../../library/asyncio-eventloop.rst:995 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:999 +#: ../../library/asyncio-eventloop.rst:1003 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1002 +#: ../../library/asyncio-eventloop.rst:1006 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1272,34 +1284,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1010 -#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1014 +#: ../../library/asyncio-eventloop.rst:1065 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1017 +#: ../../library/asyncio-eventloop.rst:1021 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1025 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1029 +#: ../../library/asyncio-eventloop.rst:1033 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1031 +#: ../../library/asyncio-eventloop.rst:1035 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1035 +#: ../../library/asyncio-eventloop.rst:1039 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1307,19 +1319,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1044 +#: ../../library/asyncio-eventloop.rst:1048 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1050 +#: ../../library/asyncio-eventloop.rst:1054 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1053 +#: ../../library/asyncio-eventloop.rst:1057 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1327,57 +1339,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:1072 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1073 +#: ../../library/asyncio-eventloop.rst:1077 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1076 +#: ../../library/asyncio-eventloop.rst:1080 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1078 +#: ../../library/asyncio-eventloop.rst:1082 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1081 +#: ../../library/asyncio-eventloop.rst:1085 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1090 +#: ../../library/asyncio-eventloop.rst:1094 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1094 +#: ../../library/asyncio-eventloop.rst:1098 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1103 +#: ../../library/asyncio-eventloop.rst:1107 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1108 +#: ../../library/asyncio-eventloop.rst:1112 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1116 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1114 +#: ../../library/asyncio-eventloop.rst:1118 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1385,67 +1397,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1122 +#: ../../library/asyncio-eventloop.rst:1126 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1126 +#: ../../library/asyncio-eventloop.rst:1130 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1131 +#: ../../library/asyncio-eventloop.rst:1135 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1133 +#: ../../library/asyncio-eventloop.rst:1137 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1137 -#: ../../library/asyncio-eventloop.rst:1153 +#: ../../library/asyncio-eventloop.rst:1141 +#: ../../library/asyncio-eventloop.rst:1157 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1142 +#: ../../library/asyncio-eventloop.rst:1146 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1151 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1149 +#: ../../library/asyncio-eventloop.rst:1153 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1158 +#: ../../library/asyncio-eventloop.rst:1162 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1163 +#: ../../library/asyncio-eventloop.rst:1167 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1168 +#: ../../library/asyncio-eventloop.rst:1172 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1172 +#: ../../library/asyncio-eventloop.rst:1176 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1178 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1453,46 +1465,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1179 +#: ../../library/asyncio-eventloop.rst:1183 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:1189 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1190 +#: ../../library/asyncio-eventloop.rst:1194 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1196 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1203 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1207 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1207 +#: ../../library/asyncio-eventloop.rst:1211 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1209 +#: ../../library/asyncio-eventloop.rst:1213 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1254 +#: ../../library/asyncio-eventloop.rst:1258 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1500,17 +1512,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1259 +#: ../../library/asyncio-eventloop.rst:1263 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1261 +#: ../../library/asyncio-eventloop.rst:1265 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1264 +#: ../../library/asyncio-eventloop.rst:1268 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1518,32 +1530,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1273 +#: ../../library/asyncio-eventloop.rst:1277 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1277 +#: ../../library/asyncio-eventloop.rst:1281 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1287 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1285 +#: ../../library/asyncio-eventloop.rst:1289 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1289 +#: ../../library/asyncio-eventloop.rst:1293 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1291 +#: ../../library/asyncio-eventloop.rst:1295 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1552,158 +1564,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1301 +#: ../../library/asyncio-eventloop.rst:1305 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1308 +#: ../../library/asyncio-eventloop.rst:1312 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1310 +#: ../../library/asyncio-eventloop.rst:1314 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1314 +#: ../../library/asyncio-eventloop.rst:1318 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1319 +#: ../../library/asyncio-eventloop.rst:1323 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1321 +#: ../../library/asyncio-eventloop.rst:1325 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1324 +#: ../../library/asyncio-eventloop.rst:1328 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1329 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1326 +#: ../../library/asyncio-eventloop.rst:1330 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1327 +#: ../../library/asyncio-eventloop.rst:1331 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1328 +#: ../../library/asyncio-eventloop.rst:1332 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1333 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1330 +#: ../../library/asyncio-eventloop.rst:1334 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1335 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1333 +#: ../../library/asyncio-eventloop.rst:1337 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1333 +#: ../../library/asyncio-eventloop.rst:1337 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1337 +#: ../../library/asyncio-eventloop.rst:1341 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1342 +#: ../../library/asyncio-eventloop.rst:1346 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1350 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1348 +#: ../../library/asyncio-eventloop.rst:1352 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1354 +#: ../../library/asyncio-eventloop.rst:1358 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1362 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1363 +#: ../../library/asyncio-eventloop.rst:1367 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1367 +#: ../../library/asyncio-eventloop.rst:1371 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1369 +#: ../../library/asyncio-eventloop.rst:1373 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1376 +#: ../../library/asyncio-eventloop.rst:1380 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1385 +#: ../../library/asyncio-eventloop.rst:1389 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1388 +#: ../../library/asyncio-eventloop.rst:1392 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1390 +#: ../../library/asyncio-eventloop.rst:1394 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1395 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1394 +#: ../../library/asyncio-eventloop.rst:1398 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1398 +#: ../../library/asyncio-eventloop.rst:1402 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1711,136 +1723,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1404 +#: ../../library/asyncio-eventloop.rst:1408 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1407 +#: ../../library/asyncio-eventloop.rst:1411 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1409 +#: ../../library/asyncio-eventloop.rst:1413 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1411 +#: ../../library/asyncio-eventloop.rst:1415 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1414 -#: ../../library/asyncio-eventloop.rst:1426 -#: ../../library/asyncio-eventloop.rst:1438 +#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1430 +#: ../../library/asyncio-eventloop.rst:1442 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1416 -#: ../../library/asyncio-eventloop.rst:1428 -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1420 +#: ../../library/asyncio-eventloop.rst:1432 +#: ../../library/asyncio-eventloop.rst:1444 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 -#: ../../library/asyncio-eventloop.rst:1430 -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1422 +#: ../../library/asyncio-eventloop.rst:1434 +#: ../../library/asyncio-eventloop.rst:1446 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1425 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1427 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1437 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1435 +#: ../../library/asyncio-eventloop.rst:1439 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1444 +#: ../../library/asyncio-eventloop.rst:1448 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1447 +#: ../../library/asyncio-eventloop.rst:1451 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1452 +#: ../../library/asyncio-eventloop.rst:1456 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1460 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1459 +#: ../../library/asyncio-eventloop.rst:1463 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1471 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1476 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1479 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1478 +#: ../../library/asyncio-eventloop.rst:1482 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1481 +#: ../../library/asyncio-eventloop.rst:1485 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1486 +#: ../../library/asyncio-eventloop.rst:1490 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1850,105 +1862,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1495 +#: ../../library/asyncio-eventloop.rst:1499 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1499 +#: ../../library/asyncio-eventloop.rst:1503 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1504 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1509 +#: ../../library/asyncio-eventloop.rst:1513 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1515 +#: ../../library/asyncio-eventloop.rst:1519 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1518 +#: ../../library/asyncio-eventloop.rst:1522 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1526 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1524 +#: ../../library/asyncio-eventloop.rst:1528 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1535 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1533 +#: ../../library/asyncio-eventloop.rst:1537 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1537 +#: ../../library/asyncio-eventloop.rst:1541 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1541 +#: ../../library/asyncio-eventloop.rst:1545 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1558 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1559 +#: ../../library/asyncio-eventloop.rst:1563 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1566 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1565 +#: ../../library/asyncio-eventloop.rst:1569 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1570 +#: ../../library/asyncio-eventloop.rst:1574 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1576 +#: ../../library/asyncio-eventloop.rst:1580 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1578 +#: ../../library/asyncio-eventloop.rst:1582 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1581 +#: ../../library/asyncio-eventloop.rst:1585 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1957,96 +1969,96 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1592 +#: ../../library/asyncio-eventloop.rst:1596 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1596 +#: ../../library/asyncio-eventloop.rst:1600 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1618 +#: ../../library/asyncio-eventloop.rst:1622 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1628 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1628 +#: ../../library/asyncio-eventloop.rst:1632 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1630 +#: ../../library/asyncio-eventloop.rst:1634 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1644 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1642 +#: ../../library/asyncio-eventloop.rst:1646 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1645 +#: ../../library/asyncio-eventloop.rst:1649 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1651 +#: ../../library/asyncio-eventloop.rst:1655 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1653 +#: ../../library/asyncio-eventloop.rst:1657 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1668 +#: ../../library/asyncio-eventloop.rst:1672 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1673 +#: ../../library/asyncio-eventloop.rst:1677 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1675 +#: ../../library/asyncio-eventloop.rst:1679 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1679 +#: ../../library/asyncio-eventloop.rst:1683 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1689 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1687 +#: ../../library/asyncio-eventloop.rst:1691 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1697 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1699 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2054,70 +2066,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1705 +#: ../../library/asyncio-eventloop.rst:1709 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1707 +#: ../../library/asyncio-eventloop.rst:1711 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1731 +#: ../../library/asyncio-eventloop.rst:1735 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1738 +#: ../../library/asyncio-eventloop.rst:1742 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1740 +#: ../../library/asyncio-eventloop.rst:1744 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1768 +#: ../../library/asyncio-eventloop.rst:1772 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1775 +#: ../../library/asyncio-eventloop.rst:1779 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1777 +#: ../../library/asyncio-eventloop.rst:1781 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1815 +#: ../../library/asyncio-eventloop.rst:1819 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1823 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1827 +#: ../../library/asyncio-eventloop.rst:1831 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1829 +#: ../../library/asyncio-eventloop.rst:1833 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1831 +#: ../../library/asyncio-eventloop.rst:1835 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 2dd6a164f5..e9721cc7da 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-02-24 00:17+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -223,41 +223,51 @@ msgstr "" "`start_server` 會是較好的做法。" #: ../../library/asyncio-stream.rst:209 +msgid "Read up to *n* bytes from the stream." +msgstr "從串流中讀取至多 *n* 個位元組的資料。" + +#: ../../library/asyncio-stream.rst:211 msgid "" -"Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read until " -"EOF and return all read bytes." +"If *n* is not provided or set to ``-1``, read until EOF, then return all " +"read :class:`bytes`. If EOF was received and the internal buffer is empty, " +"return an empty ``bytes`` object." msgstr "" -"讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取直" -"到 EOF 並回傳所有已讀取的位元組。" +"如果沒有設定 *n* 或是被設為 ``-1``,則會持續讀取直到 EOF,然後回傳所有讀取到的 :class:`bytes`。" +"讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" + +#: ../../library/asyncio-stream.rst:216 +msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." +msgstr "如果 *n* 為 ``0``,則立即回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:212 +#: ../../library/asyncio-stream.rst:218 msgid "" -"If EOF was received and the internal buffer is empty, return an empty " -"``bytes`` object." -msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" +"If *n* is positive, return at most *n* available ``bytes`` as soon as at " +"least 1 byte is available in the internal buffer. If EOF is received before " +"any byte is read, return an empty ``bytes`` object." +msgstr "" -#: ../../library/asyncio-stream.rst:217 +#: ../../library/asyncio-stream.rst:225 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:220 +#: ../../library/asyncio-stream.rst:228 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:223 +#: ../../library/asyncio-stream.rst:231 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:228 +#: ../../library/asyncio-stream.rst:236 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:230 +#: ../../library/asyncio-stream.rst:238 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -267,11 +277,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:236 +#: ../../library/asyncio-stream.rst:244 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:238 +#: ../../library/asyncio-stream.rst:246 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -279,7 +289,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:242 +#: ../../library/asyncio-stream.rst:250 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " @@ -288,7 +298,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:246 +#: ../../library/asyncio-stream.rst:254 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -299,20 +309,20 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:255 +#: ../../library/asyncio-stream.rst:263 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:260 +#: ../../library/asyncio-stream.rst:268 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:264 +#: ../../library/asyncio-stream.rst:272 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:267 +#: ../../library/asyncio-stream.rst:275 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -320,7 +330,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:273 +#: ../../library/asyncio-stream.rst:281 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -329,14 +339,14 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:277 ../../library/asyncio-stream.rst:289 +#: ../../library/asyncio-stream.rst:285 ../../library/asyncio-stream.rst:297 msgid "The method should be used along with the ``drain()`` method::" msgstr "" "此方法應當與 ``drain()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:284 +#: ../../library/asyncio-stream.rst:292 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -345,11 +355,11 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:296 +#: ../../library/asyncio-stream.rst:304 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:298 +#: ../../library/asyncio-stream.rst:306 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" @@ -358,7 +368,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:306 +#: ../../library/asyncio-stream.rst:314 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -366,29 +376,29 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:311 +#: ../../library/asyncio-stream.rst:319 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:316 +#: ../../library/asyncio-stream.rst:324 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:320 +#: ../../library/asyncio-stream.rst:328 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:325 +#: ../../library/asyncio-stream.rst:333 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" "等待直到可以繼續寫入到串流。範例:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:331 +#: ../../library/asyncio-stream.rst:339 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -400,41 +410,41 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:341 +#: ../../library/asyncio-stream.rst:349 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: ../../library/asyncio-stream.rst:343 +#: ../../library/asyncio-stream.rst:351 msgid "Parameters:" msgstr "" -#: ../../library/asyncio-stream.rst:345 +#: ../../library/asyncio-stream.rst:353 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-stream.rst:347 +#: ../../library/asyncio-stream.rst:355 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-stream.rst:350 +#: ../../library/asyncio-stream.rst:358 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:358 +#: ../../library/asyncio-stream.rst:366 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:365 +#: ../../library/asyncio-stream.rst:373 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:367 +#: ../../library/asyncio-stream.rst:375 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " @@ -443,22 +453,22 @@ msgstr "" "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在" "這之前(例如在程式退出前)所有資料都已經被清空" -#: ../../library/asyncio-stream.rst:375 +#: ../../library/asyncio-stream.rst:383 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:380 +#: ../../library/asyncio-stream.rst:388 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:382 +#: ../../library/asyncio-stream.rst:390 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:406 +#: ../../library/asyncio-stream.rst:414 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -467,18 +477,18 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:413 +#: ../../library/asyncio-stream.rst:421 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:415 +#: ../../library/asyncio-stream.rst:423 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:449 +#: ../../library/asyncio-stream.rst:457 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -487,11 +497,11 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:454 +#: ../../library/asyncio-stream.rst:462 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:456 +#: ../../library/asyncio-stream.rst:464 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" @@ -499,25 +509,25 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:495 +#: ../../library/asyncio-stream.rst:503 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:499 +#: ../../library/asyncio-stream.rst:507 msgid "or with HTTPS::" msgstr "" "或使用 HTTPS:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:507 +#: ../../library/asyncio-stream.rst:515 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:509 +#: ../../library/asyncio-stream.rst:517 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -526,7 +536,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:544 +#: ../../library/asyncio-stream.rst:552 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -536,7 +546,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:548 +#: ../../library/asyncio-stream.rst:556 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." @@ -544,3 +554,10 @@ msgid "" msgstr "" "在\\ :ref:`監視檔案描述器以讀取事件 `\\ 範例中,有" "使用低階的 :meth:`loop.add_reader` 方法來監視檔案描述器。" + +#~ msgid "" +#~ "Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read " +#~ "until EOF and return all read bytes." +#~ msgstr "" +#~ "讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取" +#~ "直到 EOF 並回傳所有已讀取的位元組。" diff --git a/library/cmath.po b/library/cmath.po index 524cfa7601..2e1cc6d9d8 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-02-27 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,25 +35,41 @@ msgstr "" #: ../../library/cmath.rst:18 msgid "" -"On platforms with hardware and system-level support for signed zeros, " -"functions involving branch cuts are continuous on *both* sides of the branch " -"cut: the sign of the zero distinguishes one side of the branch cut from the " -"other. On platforms that do not support signed zeros the continuity is as " -"specified below." +"For functions involving branch cuts, we have the problem of deciding how to " +"define those functions on the cut itself. Following Kahan's \"Branch cuts " +"for complex elementary functions\" paper, as well as Annex G of C99 and " +"later C standards, we use the sign of zero to distinguish one side of the " +"branch cut from the other: for a branch cut along (a portion of) the real " +"axis we look at the sign of the imaginary part, while for a branch cut along " +"the imaginary axis we look at the sign of the real part." msgstr "" #: ../../library/cmath.rst:26 +msgid "" +"For example, the :func:`cmath.sqrt` function has a branch cut along the " +"negative real axis. An argument of ``complex(-2.0, -0.0)`` is treated as " +"though it lies *below* the branch cut, and so gives a result on the negative " +"imaginary axis::" +msgstr "" + +#: ../../library/cmath.rst:34 +msgid "" +"But an argument of ``complex(-2.0, 0.0)`` is treated as though it lies above " +"the branch cut::" +msgstr "" + +#: ../../library/cmath.rst:42 msgid "Conversions to and from polar coordinates" msgstr "" -#: ../../library/cmath.rst:28 +#: ../../library/cmath.rst:44 msgid "" "A Python complex number ``z`` is stored internally using *rectangular* or " "*Cartesian* coordinates. It is completely determined by its *real part* ``z." "real`` and its *imaginary part* ``z.imag``. In other words::" msgstr "" -#: ../../library/cmath.rst:35 +#: ../../library/cmath.rst:51 msgid "" "*Polar coordinates* give an alternative way to represent a complex number. " "In polar coordinates, a complex number *z* is defined by the modulus *r* and " @@ -63,180 +79,175 @@ msgid "" "to *z*." msgstr "" -#: ../../library/cmath.rst:42 +#: ../../library/cmath.rst:58 msgid "" "The following functions can be used to convert from the native rectangular " "coordinates to polar coordinates and back." msgstr "" -#: ../../library/cmath.rst:47 +#: ../../library/cmath.rst:63 msgid "" -"Return the phase of *x* (also known as the *argument* of *x*), as a float. " +"Return the phase of *x* (also known as the *argument* of *x*), as a float. " "``phase(x)`` is equivalent to ``math.atan2(x.imag, x.real)``. The result " "lies in the range [-\\ *π*, *π*], and the branch cut for this operation lies " -"along the negative real axis, continuous from above. On systems with " -"support for signed zeros (which includes most systems in current use), this " -"means that the sign of the result is the same as the sign of ``x.imag``, " -"even when ``x.imag`` is zero::" +"along the negative real axis. The sign of the result is the same as the " +"sign of ``x.imag``, even when ``x.imag`` is zero::" msgstr "" -#: ../../library/cmath.rst:64 +#: ../../library/cmath.rst:77 msgid "" "The modulus (absolute value) of a complex number *x* can be computed using " "the built-in :func:`abs` function. There is no separate :mod:`cmath` module " "function for this operation." msgstr "" -#: ../../library/cmath.rst:71 +#: ../../library/cmath.rst:84 msgid "" "Return the representation of *x* in polar coordinates. Returns a pair ``(r, " "phi)`` where *r* is the modulus of *x* and phi is the phase of *x*. " "``polar(x)`` is equivalent to ``(abs(x), phase(x))``." msgstr "" -#: ../../library/cmath.rst:79 +#: ../../library/cmath.rst:92 msgid "" "Return the complex number *x* with polar coordinates *r* and *phi*. " "Equivalent to ``r * (math.cos(phi) + math.sin(phi)*1j)``." msgstr "" -#: ../../library/cmath.rst:84 +#: ../../library/cmath.rst:97 msgid "Power and logarithmic functions" msgstr "" -#: ../../library/cmath.rst:88 +#: ../../library/cmath.rst:101 msgid "" "Return *e* raised to the power *x*, where *e* is the base of natural " "logarithms." msgstr "" -#: ../../library/cmath.rst:94 +#: ../../library/cmath.rst:107 msgid "" "Returns the logarithm of *x* to the given *base*. If the *base* is not " "specified, returns the natural logarithm of *x*. There is one branch cut, " -"from 0 along the negative real axis to -∞, continuous from above." +"from 0 along the negative real axis to -∞." msgstr "" -#: ../../library/cmath.rst:101 +#: ../../library/cmath.rst:114 msgid "" "Return the base-10 logarithm of *x*. This has the same branch cut as :func:" "`log`." msgstr "" -#: ../../library/cmath.rst:107 +#: ../../library/cmath.rst:120 msgid "" "Return the square root of *x*. This has the same branch cut as :func:`log`." msgstr "" -#: ../../library/cmath.rst:111 +#: ../../library/cmath.rst:124 msgid "Trigonometric functions" msgstr "" -#: ../../library/cmath.rst:115 +#: ../../library/cmath.rst:128 msgid "" "Return the arc cosine of *x*. There are two branch cuts: One extends right " -"from 1 along the real axis to ∞, continuous from below. The other extends " -"left from -1 along the real axis to -∞, continuous from above." +"from 1 along the real axis to ∞. The other extends left from -1 along the " +"real axis to -∞." msgstr "" -#: ../../library/cmath.rst:122 +#: ../../library/cmath.rst:135 msgid "" "Return the arc sine of *x*. This has the same branch cuts as :func:`acos`." msgstr "" -#: ../../library/cmath.rst:127 +#: ../../library/cmath.rst:140 msgid "" "Return the arc tangent of *x*. There are two branch cuts: One extends from " -"``1j`` along the imaginary axis to ``∞j``, continuous from the right. The " -"other extends from ``-1j`` along the imaginary axis to ``-∞j``, continuous " -"from the left." +"``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " +"along the imaginary axis to ``-∞j``." msgstr "" -#: ../../library/cmath.rst:135 +#: ../../library/cmath.rst:147 msgid "Return the cosine of *x*." msgstr "" -#: ../../library/cmath.rst:140 +#: ../../library/cmath.rst:152 msgid "Return the sine of *x*." msgstr "" -#: ../../library/cmath.rst:145 +#: ../../library/cmath.rst:157 msgid "Return the tangent of *x*." msgstr "" -#: ../../library/cmath.rst:149 +#: ../../library/cmath.rst:161 msgid "Hyperbolic functions" msgstr "" -#: ../../library/cmath.rst:153 +#: ../../library/cmath.rst:165 msgid "" "Return the inverse hyperbolic cosine of *x*. There is one branch cut, " -"extending left from 1 along the real axis to -∞, continuous from above." +"extending left from 1 along the real axis to -∞." msgstr "" -#: ../../library/cmath.rst:159 +#: ../../library/cmath.rst:171 msgid "" "Return the inverse hyperbolic sine of *x*. There are two branch cuts: One " -"extends from ``1j`` along the imaginary axis to ``∞j``, continuous from the " -"right. The other extends from ``-1j`` along the imaginary axis to ``-∞j``, " -"continuous from the left." +"extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " +"from ``-1j`` along the imaginary axis to ``-∞j``." msgstr "" -#: ../../library/cmath.rst:167 +#: ../../library/cmath.rst:178 msgid "" "Return the inverse hyperbolic tangent of *x*. There are two branch cuts: One " -"extends from ``1`` along the real axis to ``∞``, continuous from below. The " -"other extends from ``-1`` along the real axis to ``-∞``, continuous from " -"above." +"extends from ``1`` along the real axis to ``∞``. The other extends from " +"``-1`` along the real axis to ``-∞``." msgstr "" -#: ../../library/cmath.rst:175 +#: ../../library/cmath.rst:185 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: ../../library/cmath.rst:180 +#: ../../library/cmath.rst:190 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: ../../library/cmath.rst:185 +#: ../../library/cmath.rst:195 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: ../../library/cmath.rst:189 +#: ../../library/cmath.rst:199 msgid "Classification functions" msgstr "" -#: ../../library/cmath.rst:193 +#: ../../library/cmath.rst:203 msgid "" "Return ``True`` if both the real and imaginary parts of *x* are finite, and " "``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:201 +#: ../../library/cmath.rst:211 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is an " "infinity, and ``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:207 +#: ../../library/cmath.rst:217 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is a NaN, " "and ``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:213 +#: ../../library/cmath.rst:223 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "" -#: ../../library/cmath.rst:216 +#: ../../library/cmath.rst:226 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." msgstr "" -#: ../../library/cmath.rst:219 +#: ../../library/cmath.rst:229 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -245,19 +256,19 @@ msgid "" "within about 9 decimal digits. *rel_tol* must be greater than zero." msgstr "" -#: ../../library/cmath.rst:225 +#: ../../library/cmath.rst:235 msgid "" "*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " "zero. *abs_tol* must be at least zero." msgstr "" -#: ../../library/cmath.rst:228 +#: ../../library/cmath.rst:238 msgid "" "If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " "max(abs(a), abs(b)), abs_tol)``." msgstr "" -#: ../../library/cmath.rst:231 +#: ../../library/cmath.rst:241 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -265,49 +276,49 @@ msgid "" "considered close to themselves." msgstr "" -#: ../../library/cmath.rst:240 +#: ../../library/cmath.rst:250 msgid ":pep:`485` -- A function for testing approximate equality" msgstr "" -#: ../../library/cmath.rst:244 +#: ../../library/cmath.rst:254 msgid "Constants" msgstr "常數" -#: ../../library/cmath.rst:248 +#: ../../library/cmath.rst:258 msgid "The mathematical constant *π*, as a float." msgstr "" -#: ../../library/cmath.rst:253 +#: ../../library/cmath.rst:263 msgid "The mathematical constant *e*, as a float." msgstr "" -#: ../../library/cmath.rst:258 +#: ../../library/cmath.rst:268 msgid "The mathematical constant *τ*, as a float." msgstr "" -#: ../../library/cmath.rst:265 +#: ../../library/cmath.rst:275 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." msgstr "" -#: ../../library/cmath.rst:272 +#: ../../library/cmath.rst:282 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." msgstr "" -#: ../../library/cmath.rst:280 +#: ../../library/cmath.rst:290 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." msgstr "" -#: ../../library/cmath.rst:288 +#: ../../library/cmath.rst:298 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." msgstr "" -#: ../../library/cmath.rst:296 +#: ../../library/cmath.rst:306 msgid "" "Note that the selection of functions is similar, but not identical, to that " "in module :mod:`math`. The reason for having two modules is that some users " @@ -319,7 +330,7 @@ msgid "" "zero)." msgstr "" -#: ../../library/cmath.rst:304 +#: ../../library/cmath.rst:314 msgid "" "A note on branch cuts: They are curves along which the given function fails " "to be continuous. They are a necessary feature of many complex functions. " @@ -330,7 +341,7 @@ msgid "" "following:" msgstr "" -#: ../../library/cmath.rst:314 +#: ../../library/cmath.rst:324 msgid "" "Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " "nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the " diff --git a/library/decimal.po b/library/decimal.po index 5fb2c571ca..11e58beca7 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-26 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,18 +44,18 @@ msgstr "" #: ../../library/decimal.rst:42 msgid "" -"Decimal numbers can be represented exactly. In contrast, numbers like :" -"const:`1.1` and :const:`2.2` do not have exact representations in binary " -"floating point. End users typically would not expect ``1.1 + 2.2`` to " -"display as :const:`3.3000000000000003` as it does with binary floating point." +"Decimal numbers can be represented exactly. In contrast, numbers like " +"``1.1`` and ``2.2`` do not have exact representations in binary floating " +"point. End users typically would not expect ``1.1 + 2.2`` to display as " +"``3.3000000000000003`` as it does with binary floating point." msgstr "" #: ../../library/decimal.rst:47 msgid "" "The exactness carries over into arithmetic. In decimal floating point, " "``0.1 + 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating " -"point, the result is :const:`5.5511151231257827e-017`. While near to zero, " -"the differences prevent reliable equality testing and differences can " +"point, the result is ``5.5511151231257827e-017``. While near to zero, the " +"differences prevent reliable equality testing and differences can " "accumulate. For this reason, decimal is preferred in accounting applications " "which have strict equality invariants." msgstr "" @@ -63,11 +63,11 @@ msgstr "" #: ../../library/decimal.rst:54 msgid "" "The decimal module incorporates a notion of significant places so that " -"``1.30 + 1.20`` is :const:`2.50`. The trailing zero is kept to indicate " +"``1.30 + 1.20`` is ``2.50``. The trailing zero is kept to indicate " "significance. This is the customary presentation for monetary applications. " "For multiplication, the \"schoolbook\" approach uses all the figures in the " -"multiplicands. For instance, ``1.3 * 1.2`` gives :const:`1.56` while ``1.30 " -"* 1.20`` gives :const:`1.5600`." +"multiplicands. For instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * " +"1.20`` gives ``1.5600``." msgstr "" #: ../../library/decimal.rst:61 @@ -105,9 +105,9 @@ msgstr "" msgid "" "A decimal number is immutable. It has a sign, coefficient digits, and an " "exponent. To preserve significance, the coefficient digits do not truncate " -"trailing zeros. Decimals also include special values such as :const:" -"`Infinity`, :const:`-Infinity`, and :const:`NaN`. The standard also " -"differentiates :const:`-0` from :const:`+0`." +"trailing zeros. Decimals also include special values such as ``Infinity``, " +"``-Infinity``, and ``NaN``. The standard also differentiates ``-0`` from " +"``+0``." msgstr "" #: ../../library/decimal.rst:94 @@ -161,8 +161,8 @@ msgid "" "Decimal instances can be constructed from integers, strings, floats, or " "tuples. Construction from an integer or a float performs an exact conversion " "of the value of that integer or float. Decimal numbers include special " -"values such as :const:`NaN` which stands for \"Not a number\", positive and " -"negative :const:`Infinity`, and :const:`-0`::" +"values such as ``NaN`` which stands for \"Not a number\", positive and " +"negative ``Infinity``, and ``-0``::" msgstr "" #: ../../library/decimal.rst:163 @@ -197,9 +197,9 @@ msgstr "" #: ../../library/decimal.rst:253 msgid "" -"The :meth:`quantize` method rounds a number to a fixed exponent. This " -"method is useful for monetary applications that often round results to a " -"fixed number of places:" +"The :meth:`~Decimal.quantize` method rounds a number to a fixed exponent. " +"This method is useful for monetary applications that often round results to " +"a fixed number of places:" msgstr "" #: ../../library/decimal.rst:262 @@ -229,20 +229,20 @@ msgid "" "Contexts also have signal flags for monitoring exceptional conditions " "encountered during computations. The flags remain set until explicitly " "cleared, so it is best to clear the flags before each set of monitored " -"computations by using the :meth:`clear_flags` method. ::" +"computations by using the :meth:`~Context.clear_flags` method. ::" msgstr "" #: ../../library/decimal.rst:312 msgid "" -"The *flags* entry shows that the rational approximation to :const:`Pi` was " -"rounded (digits beyond the context precision were thrown away) and that the " -"result is inexact (some of the discarded digits were non-zero)." +"The *flags* entry shows that the rational approximation to pi was rounded " +"(digits beyond the context precision were thrown away) and that the result " +"is inexact (some of the discarded digits were non-zero)." msgstr "" #: ../../library/decimal.rst:316 msgid "" -"Individual traps are set using the dictionary in the :attr:`traps` field of " -"a context:" +"Individual traps are set using the dictionary in the :attr:`~Context.traps` " +"attribute of a context:" msgstr "" #: ../../library/decimal.rst:331 @@ -281,10 +281,10 @@ msgstr "" #: ../../library/decimal.rst:371 msgid "" -"If *value* is a :class:`tuple`, it should have three components, a sign (:" -"const:`0` for positive or :const:`1` for negative), a :class:`tuple` of " -"digits, and an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), " -"-3))`` returns ``Decimal('1.414')``." +"If *value* is a :class:`tuple`, it should have three components, a sign " +"(``0`` for positive or ``1`` for negative), a :class:`tuple` of digits, and " +"an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))`` returns " +"``Decimal('1.414')``." msgstr "" #: ../../library/decimal.rst:376 @@ -309,7 +309,7 @@ msgid "" "The purpose of the *context* argument is determining what to do if *value* " "is a malformed string. If the context traps :const:`InvalidOperation`, an " "exception is raised; otherwise, the constructor returns a new Decimal with " -"the value of :const:`NaN`." +"the value of ``NaN``." msgstr "" #: ../../library/decimal.rst:392 @@ -639,7 +639,7 @@ msgstr "" #: ../../library/decimal.rst:703 msgid "" "Like ``max(self, other)`` except that the context rounding rule is applied " -"before returning and that :const:`NaN` values are either signaled or ignored " +"before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" @@ -652,7 +652,7 @@ msgstr "" #: ../../library/decimal.rst:715 msgid "" "Like ``min(self, other)`` except that the context rounding rule is applied " -"before returning and that :const:`NaN` values are either signaled or ignored " +"before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" @@ -687,11 +687,10 @@ msgstr "" #: ../../library/decimal.rst:746 msgid "" "Normalize the number by stripping the rightmost trailing zeros and " -"converting any result equal to :const:`Decimal('0')` to :const:" -"`Decimal('0e0')`. Used for producing canonical values for attributes of an " -"equivalence class. For example, ``Decimal('32.100')`` and " -"``Decimal('0.321000e+2')`` both normalize to the equivalent value " -"``Decimal('32.1')``." +"converting any result equal to ``Decimal('0')`` to ``Decimal('0e0')``. Used " +"for producing canonical values for attributes of an equivalence class. For " +"example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both normalize " +"to the equivalent value ``Decimal('32.1')``." msgstr "" #: ../../library/decimal.rst:755 @@ -776,7 +775,7 @@ msgstr "" #: ../../library/decimal.rst:792 msgid "" "An error is returned whenever the resulting exponent is greater than :attr:" -"`Emax` or less than :attr:`Etiny`." +"`~Context.Emax` or less than :meth:`~Context.Etiny`." msgstr "" #: ../../library/decimal.rst:797 @@ -812,8 +811,8 @@ msgstr "" #: ../../library/decimal.rst:832 msgid "" -"Test whether self and other have the same exponent or whether both are :" -"const:`NaN`." +"Test whether self and other have the same exponent or whether both are " +"``NaN``." msgstr "" #: ../../library/decimal.rst:841 @@ -882,10 +881,11 @@ msgstr "" #: ../../library/decimal.rst:895 msgid "" -"The :meth:`logical_and`, :meth:`logical_invert`, :meth:`logical_or`, and :" -"meth:`logical_xor` methods expect their arguments to be *logical operands*. " -"A *logical operand* is a :class:`Decimal` instance whose exponent and sign " -"are both zero, and whose digits are all either :const:`0` or :const:`1`." +"The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" +"`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their " +"arguments to be *logical operands*. A *logical operand* is a :class:" +"`Decimal` instance whose exponent and sign are both zero, and whose digits " +"are all either ``0`` or ``1``." msgstr "" #: ../../library/decimal.rst:907 @@ -983,9 +983,9 @@ msgstr "" #: ../../library/decimal.rst:984 msgid "" "Because the traps are disabled, this context is useful for applications that " -"prefer to have result value of :const:`NaN` or :const:`Infinity` instead of " -"raising exceptions. This allows an application to complete a run in the " -"presence of conditions that would otherwise halt the program." +"prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " +"exceptions. This allows an application to complete a run in the presence of " +"conditions that would otherwise halt the program." msgstr "" #: ../../library/decimal.rst:992 @@ -1012,9 +1012,9 @@ msgstr "" #: ../../library/decimal.rst:1004 msgid "" -"The default values are :attr:`prec`\\ =\\ :const:`28`, :attr:`rounding`\\ =" -"\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:`Overflow`, :class:" -"`InvalidOperation`, and :class:`DivisionByZero`." +"The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." +"rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" +"`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." msgstr "" #: ../../library/decimal.rst:1009 @@ -1032,8 +1032,8 @@ msgstr "" #: ../../library/decimal.rst:1019 msgid "" -"*prec* is an integer in the range [:const:`1`, :const:`MAX_PREC`] that sets " -"the precision for arithmetic operations in the context." +"*prec* is an integer in the range [``1``, :const:`MAX_PREC`] that sets the " +"precision for arithmetic operations in the context." msgstr "" #: ../../library/decimal.rst:1022 @@ -1051,35 +1051,35 @@ msgstr "" #: ../../library/decimal.rst:1028 msgid "" "The *Emin* and *Emax* fields are integers specifying the outer limits " -"allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, :" -"const:`0`], *Emax* in the range [:const:`0`, :const:`MAX_EMAX`]." +"allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, " +"``0``], *Emax* in the range [``0``, :const:`MAX_EMAX`]." msgstr "" #: ../../library/decimal.rst:1032 msgid "" -"The *capitals* field is either :const:`0` or :const:`1` (the default). If " -"set to :const:`1`, exponents are printed with a capital :const:`E`; " -"otherwise, a lowercase :const:`e` is used: :const:`Decimal('6.02e+23')`." +"The *capitals* field is either ``0`` or ``1`` (the default). If set to " +"``1``, exponents are printed with a capital ``E``; otherwise, a lowercase " +"``e`` is used: ``Decimal('6.02e+23')``." msgstr "" #: ../../library/decimal.rst:1036 msgid "" -"The *clamp* field is either :const:`0` (the default) or :const:`1`. If set " -"to :const:`1`, the exponent ``e`` of a :class:`Decimal` instance " -"representable in this context is strictly limited to the range ``Emin - prec " -"+ 1 <= e <= Emax - prec + 1``. If *clamp* is :const:`0` then a weaker " -"condition holds: the adjusted exponent of the :class:`Decimal` instance is " -"at most ``Emax``. When *clamp* is :const:`1`, a large normal number will, " -"where possible, have its exponent reduced and a corresponding number of " -"zeros added to its coefficient, in order to fit the exponent constraints; " -"this preserves the value of the number but loses information about " -"significant trailing zeros. For example::" +"The *clamp* field is either ``0`` (the default) or ``1``. If set to ``1``, " +"the exponent ``e`` of a :class:`Decimal` instance representable in this " +"context is strictly limited to the range ``Emin - prec + 1 <= e <= Emax - " +"prec + 1``. If *clamp* is ``0`` then a weaker condition holds: the adjusted " +"exponent of the :class:`Decimal` instance is at most :attr:`~Context.Emax`. " +"When *clamp* is ``1``, a large normal number will, where possible, have its " +"exponent reduced and a corresponding number of zeros added to its " +"coefficient, in order to fit the exponent constraints; this preserves the " +"value of the number but loses information about significant trailing zeros. " +"For example::" msgstr "" #: ../../library/decimal.rst:1051 msgid "" -"A *clamp* value of :const:`1` allows compatibility with the fixed-width " -"decimal interchange formats specified in IEEE 754." +"A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " +"interchange formats specified in IEEE 754." msgstr "" #: ../../library/decimal.rst:1054 @@ -1087,20 +1087,20 @@ msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " "context. In addition, for each of the :class:`Decimal` methods described " -"above (with the exception of the :meth:`adjusted` and :meth:`as_tuple` " -"methods) there is a corresponding :class:`Context` method. For example, for " -"a :class:`Context` instance ``C`` and :class:`Decimal` instance ``x``, ``C." -"exp(x)`` is equivalent to ``x.exp(context=C)``. Each :class:`Context` " -"method accepts a Python integer (an instance of :class:`int`) anywhere that " -"a Decimal instance is accepted." +"above (with the exception of the :meth:`~Decimal.adjusted` and :meth:" +"`~Decimal.as_tuple` methods) there is a corresponding :class:`Context` " +"method. For example, for a :class:`Context` instance ``C`` and :class:" +"`Decimal` instance ``x``, ``C.exp(x)`` is equivalent to ``x." +"exp(context=C)``. Each :class:`Context` method accepts a Python integer (an " +"instance of :class:`int`) anywhere that a Decimal instance is accepted." msgstr "" #: ../../library/decimal.rst:1067 -msgid "Resets all of the flags to :const:`0`." +msgid "Resets all of the flags to ``0``." msgstr "" #: ../../library/decimal.rst:1071 -msgid "Resets all of the traps to :const:`0`." +msgid "Resets all of the traps to ``0``." msgstr "" #: ../../library/decimal.rst:1077 @@ -1473,28 +1473,28 @@ msgid "64-bit" msgstr "" #: ../../library/decimal.rst:1486 ../../library/decimal.rst:1488 -msgid ":const:`425000000`" -msgstr ":const:`425000000`" +msgid "``425000000``" +msgstr "``425000000``" #: ../../library/decimal.rst:1486 ../../library/decimal.rst:1488 -msgid ":const:`999999999999999999`" -msgstr ":const:`999999999999999999`" +msgid "``999999999999999999``" +msgstr "``999999999999999999``" #: ../../library/decimal.rst:1490 -msgid ":const:`-425000000`" -msgstr ":const:`-425000000`" +msgid "``-425000000``" +msgstr "``-425000000``" #: ../../library/decimal.rst:1490 -msgid ":const:`-999999999999999999`" -msgstr ":const:`-999999999999999999`" +msgid "``-999999999999999999``" +msgstr "``-999999999999999999``" #: ../../library/decimal.rst:1492 -msgid ":const:`-849999999`" -msgstr ":const:`-849999999`" +msgid "``-849999999``" +msgstr "``-849999999``" #: ../../library/decimal.rst:1492 -msgid ":const:`-1999999999999999997`" -msgstr ":const:`-1999999999999999997`" +msgid "``-1999999999999999997``" +msgstr "``-1999999999999999997``" #: ../../library/decimal.rst:1498 msgid "" @@ -1519,7 +1519,7 @@ msgid "Rounding modes" msgstr "" #: ../../library/decimal.rst:1517 -msgid "Round towards :const:`Infinity`." +msgid "Round towards ``Infinity``." msgstr "" #: ../../library/decimal.rst:1521 @@ -1527,7 +1527,7 @@ msgid "Round towards zero." msgstr "" #: ../../library/decimal.rst:1525 -msgid "Round towards :const:`-Infinity`." +msgid "Round towards ``-Infinity``." msgstr "" #: ../../library/decimal.rst:1529 @@ -1585,8 +1585,8 @@ msgstr "" #: ../../library/decimal.rst:1572 msgid "" "Typically, clamping occurs when an exponent falls outside the context's :" -"attr:`Emin` and :attr:`Emax` limits. If possible, the exponent is reduced " -"to fit by adding zeros to the coefficient." +"attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " +"exponent is reduced to fit by adding zeros to the coefficient." msgstr "" #: ../../library/decimal.rst:1579 @@ -1600,9 +1600,8 @@ msgstr "" #: ../../library/decimal.rst:1586 msgid "" "Can occur with division, modulo division, or when raising a number to a " -"negative power. If this signal is not trapped, returns :const:`Infinity` " -"or :const:`-Infinity` with the sign determined by the inputs to the " -"calculation." +"negative power. If this signal is not trapped, returns ``Infinity`` or ``-" +"Infinity`` with the sign determined by the inputs to the calculation." msgstr "" #: ../../library/decimal.rst:1593 @@ -1623,7 +1622,7 @@ msgstr "" #: ../../library/decimal.rst:1604 msgid "" "Indicates that an operation was requested that does not make sense. If not " -"trapped, returns :const:`NaN`. Possible causes include::" +"trapped, returns ``NaN``. Possible causes include::" msgstr "" #: ../../library/decimal.rst:1620 @@ -1632,10 +1631,10 @@ msgstr "" #: ../../library/decimal.rst:1622 msgid "" -"Indicates the exponent is larger than :attr:`Emax` after rounding has " -"occurred. If not trapped, the result depends on the rounding mode, either " -"pulling inward to the largest representable finite number or rounding " -"outward to :const:`Infinity`. In either case, :class:`Inexact` and :class:" +"Indicates the exponent is larger than :attr:`Context.Emax` after rounding " +"has occurred. If not trapped, the result depends on the rounding mode, " +"either pulling inward to the largest representable finite number or rounding " +"outward to ``Infinity``. In either case, :class:`Inexact` and :class:" "`Rounded` are also signaled." msgstr "" @@ -1646,13 +1645,12 @@ msgstr "" #: ../../library/decimal.rst:1633 msgid "" "Signaled whenever rounding discards digits; even if those digits are zero " -"(such as rounding :const:`5.00` to :const:`5.0`). If not trapped, returns " -"the result unchanged. This signal is used to detect loss of significant " -"digits." +"(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " +"unchanged. This signal is used to detect loss of significant digits." msgstr "" #: ../../library/decimal.rst:1641 -msgid "Exponent was lower than :attr:`Emin` prior to rounding." +msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." msgstr "" #: ../../library/decimal.rst:1643 @@ -1708,9 +1706,9 @@ msgstr "" #: ../../library/decimal.rst:1698 msgid "" "The use of decimal floating point eliminates decimal representation error " -"(making it possible to represent :const:`0.1` exactly); however, some " -"operations can still incur round-off error when non-zero digits exceed the " -"fixed precision." +"(making it possible to represent ``0.1`` exactly); however, some operations " +"can still incur round-off error when non-zero digits exceed the fixed " +"precision." msgstr "" #: ../../library/decimal.rst:1702 @@ -1735,8 +1733,8 @@ msgstr "" #: ../../library/decimal.rst:1748 msgid "" "The number system for the :mod:`decimal` module provides special values " -"including :const:`NaN`, :const:`sNaN`, :const:`-Infinity`, :const:" -"`Infinity`, and two zeros, :const:`+0` and :const:`-0`." +"including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " +"``+0`` and ``-0``." msgstr "" #: ../../library/decimal.rst:1752 @@ -1757,37 +1755,37 @@ msgstr "" #: ../../library/decimal.rst:1761 msgid "" -"Some operations are indeterminate and return :const:`NaN`, or if the :exc:" +"Some operations are indeterminate and return ``NaN``, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " -"``0/0`` returns :const:`NaN` which means \"not a number\". This variety of :" -"const:`NaN` is quiet and, once created, will flow through other computations " -"always resulting in another :const:`NaN`. This behavior can be useful for a " +"``0/0`` returns ``NaN`` which means \"not a number\". This variety of " +"``NaN`` is quiet and, once created, will flow through other computations " +"always resulting in another ``NaN``. This behavior can be useful for a " "series of computations that occasionally have missing inputs --- it allows " "the calculation to proceed while flagging specific results as invalid." msgstr "" #: ../../library/decimal.rst:1769 msgid "" -"A variant is :const:`sNaN` which signals rather than remaining quiet after " -"every operation. This is a useful return value when an invalid result needs " -"to interrupt a calculation for special handling." +"A variant is ``sNaN`` which signals rather than remaining quiet after every " +"operation. This is a useful return value when an invalid result needs to " +"interrupt a calculation for special handling." msgstr "" #: ../../library/decimal.rst:1773 msgid "" "The behavior of Python's comparison operators can be a little surprising " -"where a :const:`NaN` is involved. A test for equality where one of the " -"operands is a quiet or signaling :const:`NaN` always returns :const:`False` " -"(even when doing ``Decimal('NaN')==Decimal('NaN')``), while a test for " -"inequality always returns :const:`True`. An attempt to compare two Decimals " -"using any of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :" -"exc:`InvalidOperation` signal if either operand is a :const:`NaN`, and " -"return :const:`False` if this signal is not trapped. Note that the General " -"Decimal Arithmetic specification does not specify the behavior of direct " -"comparisons; these rules for comparisons involving a :const:`NaN` were taken " -"from the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict " -"standards-compliance, use the :meth:`compare` and :meth:`compare-signal` " -"methods instead." +"where a ``NaN`` is involved. A test for equality where one of the operands " +"is a quiet or signaling ``NaN`` always returns :const:`False` (even when " +"doing ``Decimal('NaN')==Decimal('NaN')``), while a test for inequality " +"always returns :const:`True`. An attempt to compare two Decimals using any " +"of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :exc:" +"`InvalidOperation` signal if either operand is a ``NaN``, and return :const:" +"`False` if this signal is not trapped. Note that the General Decimal " +"Arithmetic specification does not specify the behavior of direct " +"comparisons; these rules for comparisons involving a ``NaN`` were taken from " +"the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict " +"standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal." +"compare_signal` methods instead." msgstr "" #: ../../library/decimal.rst:1786 @@ -1874,8 +1872,9 @@ msgstr "" #: ../../library/decimal.rst:2016 msgid "" -"A. The :meth:`quantize` method rounds to a fixed number of decimal places. " -"If the :const:`Inexact` trap is set, it is also useful for validation:" +"A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " +"places. If the :const:`Inexact` trap is set, it is also useful for " +"validation:" msgstr "" #: ../../library/decimal.rst:2034 @@ -1889,27 +1888,27 @@ msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " "division and non-integer multiplication, will change the number of decimal " -"places and need to be followed-up with a :meth:`quantize` step:" +"places and need to be followed-up with a :meth:`~Decimal.quantize` step:" msgstr "" #: ../../library/decimal.rst:2055 msgid "" "In developing fixed-point applications, it is convenient to define functions " -"to handle the :meth:`quantize` step:" +"to handle the :meth:`~Decimal.quantize` step:" msgstr "" #: ../../library/decimal.rst:2068 msgid "" -"Q. There are many ways to express the same value. The numbers :const:" -"`200`, :const:`200.000`, :const:`2E2`, and :const:`.02E+4` all have the same " -"value at various precisions. Is there a way to transform them to a single " -"recognizable canonical value?" +"Q. There are many ways to express the same value. The numbers ``200``, " +"``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " +"precisions. Is there a way to transform them to a single recognizable " +"canonical value?" msgstr "" #: ../../library/decimal.rst:2073 msgid "" -"A. The :meth:`normalize` method maps all equivalent values to a single " -"representative:" +"A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " +"single representative:" msgstr "" #: ../../library/decimal.rst:2080 @@ -1921,8 +1920,8 @@ msgstr "" #: ../../library/decimal.rst:2083 msgid "" "A. For some values, exponential notation is the only way to express the " -"number of significant places in the coefficient. For example, expressing :" -"const:`5.0E+3` as :const:`5000` keeps the value constant but cannot show the " +"number of significant places in the coefficient. For example, expressing " +"``5.0E+3`` as ``5000`` keeps the value constant but cannot show the " "original's two-place significance." msgstr "" @@ -2006,15 +2005,15 @@ msgstr "" #: ../../library/decimal.rst:2161 msgid "" "The context must be adapted for exact arbitrary precision arithmetic. :attr:" -"`Emin` and :attr:`Emax` should always be set to the maximum values, :attr:" -"`clamp` should always be 0 (the default). Setting :attr:`prec` requires " -"some care." +"`~Context.Emin` and :attr:`~Context.Emax` should always be set to the " +"maximum values, :attr:`~Context.clamp` should always be 0 (the default). " +"Setting :attr:`~Context.prec` requires some care." msgstr "" #: ../../library/decimal.rst:2165 msgid "" "The easiest approach for trying out bignum arithmetic is to use the maximum " -"value for :attr:`prec` as well [#]_::" +"value for :attr:`~Context.prec` as well [#]_::" msgstr "" #: ../../library/decimal.rst:2174 @@ -2026,9 +2025,9 @@ msgstr "" #: ../../library/decimal.rst:2182 msgid "" "On systems with overallocation (e.g. Linux), a more sophisticated approach " -"is to adjust :attr:`prec` to the amount of available RAM. Suppose that you " -"have 8GB of RAM and expect 10 simultaneous operands using a maximum of 500MB " -"each::" +"is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose " +"that you have 8GB of RAM and expect 10 simultaneous operands using a maximum " +"of 500MB each::" msgstr "" #: ../../library/decimal.rst:2206 diff --git a/library/functions.po b/library/functions.po index 4244b761ca..9125b59108 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-03 00:16+0000\n" +"POT-Creation-Date: 2023-02-25 00:17+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1225,12 +1225,11 @@ msgstr "增加了 *closure* 參數。" #: ../../library/functions.rst:624 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " -"returns true. *iterable* may be either a sequence, a container which " -"supports iteration, or an iterator. If *function* is ``None``, the identity " -"function is assumed, that is, all elements of *iterable* that are false are " -"removed." +"is true. *iterable* may be either a sequence, a container which supports " +"iteration, or an iterator. If *function* is ``None``, the identity function " +"is assumed, that is, all elements of *iterable* that are false are removed." msgstr "" -"用 *iterable* 中函式 *function* 回傳 True 的那些元素,構建一個新的 iterator。" +"用 *iterable* 中函式 *function* 為 True 的那些元素,構建一個新的 iterator。" "*iterable* 可以是一個序列、一個支援疊代的容器、或一個 iterator。如果 " "*function* 是 ``None``,則會假設它是一個恆等函數,即 *iterable* 中所有假值元" "素會被移除。" @@ -1249,9 +1248,9 @@ msgstr "" #: ../../library/functions.rst:635 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " -"returns elements of *iterable* for which *function* returns false." +"returns elements of *iterable* for which *function* is false." msgstr "" -"請參閱 :func:`itertools.filterfalse`,只有 *function* 回傳 false 時才選取 " +"請參閱 :func:`itertools.filterfalse`,只有 *function* 為 false 時才選取 " "*iterable* 中元素的互補函數。" #: ../../library/functions.rst:645 diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index c8751d6a93..f688a557f9 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-27 00:19+0000\n" +"POT-Creation-Date: 2023-02-26 00:19+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -114,52 +114,58 @@ msgstr "" #: ../../library/importlib.resources.abc.rst:89 msgid "" -"An object with a subset of pathlib.Path methods suitable for traversing " -"directories and opening files." +"An object with a subset of :class:`pathlib.Path` methods suitable for " +"traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:96 +#: ../../library/importlib.resources.abc.rst:92 +msgid "" +"For a representation of the object on the file-system, use :meth:`importlib." +"resources.as_file`." +msgstr "" + +#: ../../library/importlib.resources.abc.rst:99 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:100 +#: ../../library/importlib.resources.abc.rst:103 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:104 +#: ../../library/importlib.resources.abc.rst:107 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:108 +#: ../../library/importlib.resources.abc.rst:111 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:112 -#: ../../library/importlib.resources.abc.rst:116 +#: ../../library/importlib.resources.abc.rst:115 +#: ../../library/importlib.resources.abc.rst:119 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:120 +#: ../../library/importlib.resources.abc.rst:123 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.resources.abc.rst:123 +#: ../../library/importlib.resources.abc.rst:126 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "attr:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:128 +#: ../../library/importlib.resources.abc.rst:131 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:132 +#: ../../library/importlib.resources.abc.rst:135 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:137 +#: ../../library/importlib.resources.abc.rst:140 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -169,13 +175,13 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.resources.abc.rst:144 +#: ../../library/importlib.resources.abc.rst:147 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:151 +#: ../../library/importlib.resources.abc.rst:154 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/inspect.po b/library/inspect.po index 656feba57d..c9bfd85dfb 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-02-28 00:17+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -969,7 +969,7 @@ msgid "" "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:683 ../../library/inspect.rst:1007 +#: ../../library/inspect.rst:683 ../../library/inspect.rst:1008 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " @@ -1069,83 +1069,84 @@ msgstr "" #: ../../library/inspect.rst:783 msgid "" -"Describes how argument values are bound to the parameter. Possible values " -"(accessible via :class:`Parameter`, like ``Parameter.KEYWORD_ONLY``):" +"Describes how argument values are bound to the parameter. The possible " +"values are accessible via :class:`Parameter` (like ``Parameter." +"KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:790 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:790 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:791 +#: ../../library/inspect.rst:792 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:791 +#: ../../library/inspect.rst:792 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:797 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:796 +#: ../../library/inspect.rst:797 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:802 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:802 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:806 +#: ../../library/inspect.rst:807 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:806 +#: ../../library/inspect.rst:807 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:811 +#: ../../library/inspect.rst:812 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:811 +#: ../../library/inspect.rst:812 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:817 +#: ../../library/inspect.rst:818 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:831 +#: ../../library/inspect.rst:832 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:835 +#: ../../library/inspect.rst:836 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:850 +#: ../../library/inspect.rst:851 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1153,94 +1154,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:868 +#: ../../library/inspect.rst:869 msgid "" "In Python 3.3 Parameter objects were allowed to have ``name`` set to " "``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " "permitted." msgstr "" -#: ../../library/inspect.rst:875 +#: ../../library/inspect.rst:876 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:880 +#: ../../library/inspect.rst:881 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:884 +#: ../../library/inspect.rst:885 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:889 +#: ../../library/inspect.rst:890 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:894 +#: ../../library/inspect.rst:895 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:900 +#: ../../library/inspect.rst:901 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:905 +#: ../../library/inspect.rst:906 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:910 +#: ../../library/inspect.rst:911 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:914 +#: ../../library/inspect.rst:915 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:916 +#: ../../library/inspect.rst:917 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:919 +#: ../../library/inspect.rst:920 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:933 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:945 +#: ../../library/inspect.rst:946 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:947 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:952 +#: ../../library/inspect.rst:953 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:956 +#: ../../library/inspect.rst:957 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1251,19 +1252,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:967 +#: ../../library/inspect.rst:968 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:970 +#: ../../library/inspect.rst:971 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:973 +#: ../../library/inspect.rst:974 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1278,7 +1279,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:988 +#: ../../library/inspect.rst:989 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1288,14 +1289,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:995 +#: ../../library/inspect.rst:996 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:1001 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1303,7 +1304,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1015 +#: ../../library/inspect.rst:1016 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1312,18 +1313,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1022 ../../library/inspect.rst:1032 +#: ../../library/inspect.rst:1023 ../../library/inspect.rst:1033 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1027 +#: ../../library/inspect.rst:1028 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1037 +#: ../../library/inspect.rst:1038 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1331,7 +1332,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1045 +#: ../../library/inspect.rst:1046 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1344,11 +1345,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1068 +#: ../../library/inspect.rst:1069 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1074 +#: ../../library/inspect.rst:1075 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1360,18 +1361,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1083 +#: ../../library/inspect.rst:1084 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1090 +#: ../../library/inspect.rst:1091 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1093 +#: ../../library/inspect.rst:1094 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1381,68 +1382,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1100 +#: ../../library/inspect.rst:1101 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1107 +#: ../../library/inspect.rst:1108 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1109 +#: ../../library/inspect.rst:1110 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1112 +#: ../../library/inspect.rst:1113 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1116 +#: ../../library/inspect.rst:1117 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1118 +#: ../../library/inspect.rst:1119 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1122 +#: ../../library/inspect.rst:1123 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1126 +#: ../../library/inspect.rst:1127 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1128 +#: ../../library/inspect.rst:1129 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1130 +#: ../../library/inspect.rst:1131 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1132 +#: ../../library/inspect.rst:1133 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1136 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1450,12 +1451,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1139 +#: ../../library/inspect.rst:1140 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1141 +#: ../../library/inspect.rst:1142 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1463,35 +1464,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1146 +#: ../../library/inspect.rst:1147 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1148 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1150 +#: ../../library/inspect.rst:1151 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1154 +#: ../../library/inspect.rst:1155 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1164 +#: ../../library/inspect.rst:1165 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1166 +#: ../../library/inspect.rst:1167 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1499,95 +1500,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1175 +#: ../../library/inspect.rst:1176 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1179 +#: ../../library/inspect.rst:1180 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1184 +#: ../../library/inspect.rst:1185 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1189 +#: ../../library/inspect.rst:1190 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1193 +#: ../../library/inspect.rst:1194 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1198 ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1199 ../../library/inspect.rst:1238 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1202 +#: ../../library/inspect.rst:1203 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1206 +#: ../../library/inspect.rst:1207 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1209 +#: ../../library/inspect.rst:1210 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1218 +#: ../../library/inspect.rst:1219 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1223 +#: ../../library/inspect.rst:1224 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1228 +#: ../../library/inspect.rst:1229 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1232 +#: ../../library/inspect.rst:1233 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1241 +#: ../../library/inspect.rst:1242 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1247 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1253 +#: ../../library/inspect.rst:1254 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1599,7 +1600,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1261 +#: ../../library/inspect.rst:1262 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1607,31 +1608,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1273 +#: ../../library/inspect.rst:1274 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1277 +#: ../../library/inspect.rst:1278 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1284 +#: ../../library/inspect.rst:1285 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1287 +#: ../../library/inspect.rst:1288 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1292 +#: ../../library/inspect.rst:1293 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1639,19 +1640,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1297 ../../library/inspect.rst:1312 -#: ../../library/inspect.rst:1338 ../../library/inspect.rst:1353 +#: ../../library/inspect.rst:1298 ../../library/inspect.rst:1313 +#: ../../library/inspect.rst:1339 ../../library/inspect.rst:1354 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1302 ../../library/inspect.rst:1317 -#: ../../library/inspect.rst:1343 ../../library/inspect.rst:1358 +#: ../../library/inspect.rst:1303 ../../library/inspect.rst:1318 +#: ../../library/inspect.rst:1344 ../../library/inspect.rst:1359 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1307 +#: ../../library/inspect.rst:1308 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1659,11 +1660,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1322 +#: ../../library/inspect.rst:1323 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1326 +#: ../../library/inspect.rst:1327 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1671,14 +1672,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1334 +#: ../../library/inspect.rst:1335 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1348 +#: ../../library/inspect.rst:1349 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1686,11 +1687,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1362 +#: ../../library/inspect.rst:1363 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1364 +#: ../../library/inspect.rst:1365 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1698,20 +1699,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1370 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1375 +#: ../../library/inspect.rst:1376 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1378 +#: ../../library/inspect.rst:1379 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1719,31 +1720,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1384 +#: ../../library/inspect.rst:1385 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1390 +#: ../../library/inspect.rst:1391 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1394 +#: ../../library/inspect.rst:1395 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1420 +#: ../../library/inspect.rst:1421 msgid "Current State of Generators and Coroutines" msgstr "" -#: ../../library/inspect.rst:1422 +#: ../../library/inspect.rst:1423 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1752,31 +1753,31 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1430 +#: ../../library/inspect.rst:1431 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1436 ../../library/inspect.rst:1451 +#: ../../library/inspect.rst:1437 ../../library/inspect.rst:1452 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1433 +#: ../../library/inspect.rst:1434 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1434 +#: ../../library/inspect.rst:1435 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1435 +#: ../../library/inspect.rst:1436 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1436 +#: ../../library/inspect.rst:1437 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1442 +#: ../../library/inspect.rst:1443 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1784,30 +1785,30 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1448 +#: ../../library/inspect.rst:1449 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1449 +#: ../../library/inspect.rst:1450 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1451 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1451 +#: ../../library/inspect.rst:1452 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1455 +#: ../../library/inspect.rst:1456 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1461 +#: ../../library/inspect.rst:1462 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1815,14 +1816,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1466 +#: ../../library/inspect.rst:1467 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1472 +#: ../../library/inspect.rst:1473 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1830,72 +1831,72 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1482 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1490 +#: ../../library/inspect.rst:1491 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1492 +#: ../../library/inspect.rst:1493 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1497 +#: ../../library/inspect.rst:1498 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1501 +#: ../../library/inspect.rst:1502 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1506 +#: ../../library/inspect.rst:1507 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1510 +#: ../../library/inspect.rst:1511 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1514 +#: ../../library/inspect.rst:1515 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1518 +#: ../../library/inspect.rst:1519 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1523 +#: ../../library/inspect.rst:1524 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1531 +#: ../../library/inspect.rst:1532 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1540 +#: ../../library/inspect.rst:1541 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1547 +#: ../../library/inspect.rst:1548 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1903,24 +1904,24 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1557 +#: ../../library/inspect.rst:1558 msgid "Command Line Interface" msgstr "" -#: ../../library/inspect.rst:1559 +#: ../../library/inspect.rst:1560 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1564 +#: ../../library/inspect.rst:1565 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1571 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/itertools.po b/library/itertools.po index bd005e9b6f..dea7809614 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-08 00:17+0000\n" +"POT-Creation-Date: 2023-02-25 00:17+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-" @@ -580,7 +580,7 @@ msgstr "" #: ../../library/itertools.rst:361 msgid "" "Make an iterator that filters elements from iterable returning only those " -"for which the predicate is ``False``. If *predicate* is ``None``, return the " +"for which the predicate is false. If *predicate* is ``None``, return the " "items that are false. Roughly equivalent to::" msgstr "" diff --git a/library/os.po b/library/os.po index bab3ea2ef3..e3af33d909 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-03-04 00:16+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -285,43 +285,42 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../library/os.rst:181 ../../library/os.rst:353 ../../library/os.rst:362 -#: ../../library/os.rst:384 ../../library/os.rst:393 ../../library/os.rst:429 -#: ../../library/os.rst:437 ../../library/os.rst:475 ../../library/os.rst:486 -#: ../../library/os.rst:496 ../../library/os.rst:506 ../../library/os.rst:529 -#: ../../library/os.rst:563 ../../library/os.rst:570 ../../library/os.rst:577 -#: ../../library/os.rst:586 ../../library/os.rst:598 ../../library/os.rst:607 -#: ../../library/os.rst:624 ../../library/os.rst:633 ../../library/os.rst:640 -#: ../../library/os.rst:649 ../../library/os.rst:658 ../../library/os.rst:665 -#: ../../library/os.rst:672 ../../library/os.rst:681 ../../library/os.rst:1046 -#: ../../library/os.rst:1190 ../../library/os.rst:1216 -#: ../../library/os.rst:1453 ../../library/os.rst:1488 -#: ../../library/os.rst:1497 ../../library/os.rst:1861 -#: ../../library/os.rst:1950 ../../library/os.rst:1990 -#: ../../library/os.rst:2207 ../../library/os.rst:2229 -#: ../../library/os.rst:3757 ../../library/os.rst:3764 -#: ../../library/os.rst:3771 ../../library/os.rst:3778 -#: ../../library/os.rst:3785 ../../library/os.rst:3792 -#: ../../library/os.rst:3799 ../../library/os.rst:3807 -#: ../../library/os.rst:3815 ../../library/os.rst:3822 -#: ../../library/os.rst:3829 ../../library/os.rst:3838 -#: ../../library/os.rst:3846 ../../library/os.rst:3854 -#: ../../library/os.rst:3861 ../../library/os.rst:3868 -#: ../../library/os.rst:3889 ../../library/os.rst:3906 -#: ../../library/os.rst:3946 ../../library/os.rst:3953 -#: ../../library/os.rst:3974 ../../library/os.rst:4101 -#: ../../library/os.rst:4150 ../../library/os.rst:4387 -#: ../../library/os.rst:4421 ../../library/os.rst:4479 -#: ../../library/os.rst:4493 ../../library/os.rst:4510 -#: ../../library/os.rst:4525 ../../library/os.rst:4536 -#: ../../library/os.rst:4548 ../../library/os.rst:4561 -#: ../../library/os.rst:4570 ../../library/os.rst:4580 -#: ../../library/os.rst:4593 ../../library/os.rst:4644 -#: ../../library/os.rst:4655 ../../library/os.rst:4667 -#: ../../library/os.rst:4674 ../../library/os.rst:4683 -#: ../../library/os.rst:4692 ../../library/os.rst:4701 -#: ../../library/os.rst:4710 -#, fuzzy +#: ../../library/os.rst:181 ../../library/os.rst:358 ../../library/os.rst:367 +#: ../../library/os.rst:389 ../../library/os.rst:398 ../../library/os.rst:434 +#: ../../library/os.rst:442 ../../library/os.rst:480 ../../library/os.rst:491 +#: ../../library/os.rst:501 ../../library/os.rst:511 ../../library/os.rst:534 +#: ../../library/os.rst:568 ../../library/os.rst:575 ../../library/os.rst:582 +#: ../../library/os.rst:591 ../../library/os.rst:603 ../../library/os.rst:612 +#: ../../library/os.rst:629 ../../library/os.rst:638 ../../library/os.rst:645 +#: ../../library/os.rst:654 ../../library/os.rst:663 ../../library/os.rst:670 +#: ../../library/os.rst:677 ../../library/os.rst:686 ../../library/os.rst:1051 +#: ../../library/os.rst:1195 ../../library/os.rst:1221 +#: ../../library/os.rst:1458 ../../library/os.rst:1493 +#: ../../library/os.rst:1502 ../../library/os.rst:1866 +#: ../../library/os.rst:1955 ../../library/os.rst:1995 +#: ../../library/os.rst:2212 ../../library/os.rst:2234 +#: ../../library/os.rst:3762 ../../library/os.rst:3769 +#: ../../library/os.rst:3776 ../../library/os.rst:3783 +#: ../../library/os.rst:3790 ../../library/os.rst:3797 +#: ../../library/os.rst:3804 ../../library/os.rst:3812 +#: ../../library/os.rst:3820 ../../library/os.rst:3827 +#: ../../library/os.rst:3834 ../../library/os.rst:3843 +#: ../../library/os.rst:3851 ../../library/os.rst:3859 +#: ../../library/os.rst:3866 ../../library/os.rst:3873 +#: ../../library/os.rst:3894 ../../library/os.rst:3911 +#: ../../library/os.rst:3951 ../../library/os.rst:3958 +#: ../../library/os.rst:3979 ../../library/os.rst:4106 +#: ../../library/os.rst:4155 ../../library/os.rst:4392 +#: ../../library/os.rst:4426 ../../library/os.rst:4484 +#: ../../library/os.rst:4498 ../../library/os.rst:4515 +#: ../../library/os.rst:4530 ../../library/os.rst:4541 +#: ../../library/os.rst:4553 ../../library/os.rst:4566 +#: ../../library/os.rst:4575 ../../library/os.rst:4585 +#: ../../library/os.rst:4598 ../../library/os.rst:4649 +#: ../../library/os.rst:4660 ../../library/os.rst:4672 +#: ../../library/os.rst:4679 ../../library/os.rst:4688 +#: ../../library/os.rst:4697 ../../library/os.rst:4706 +#: ../../library/os.rst:4715 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -356,19 +355,26 @@ msgid "" "to use a different encoding." msgstr "" -#: ../../library/os.rst:206 +#: ../../library/os.rst:204 +msgid "" +"On Windows, the keys are converted to uppercase. This also applies when " +"getting, setting, or deleting an item. For example, ``environ['monty'] = " +"'python'`` maps the key ``'MONTY'`` to the value ``'python'``." +msgstr "" + +#: ../../library/os.rst:211 msgid "" "Calling :func:`putenv` directly does not change :data:`os.environ`, so it's " "better to modify :data:`os.environ`." msgstr "" -#: ../../library/os.rst:211 +#: ../../library/os.rst:216 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." msgstr "" -#: ../../library/os.rst:215 +#: ../../library/os.rst:220 msgid "" "You can delete items in this mapping to unset environment variables. :func:" "`unsetenv` will be called automatically when an item is deleted from :data:" @@ -376,12 +382,12 @@ msgid "" "called." msgstr "" -#: ../../library/os.rst:220 ../../library/os.rst:236 +#: ../../library/os.rst:225 ../../library/os.rst:241 msgid "" "Updated to support :pep:`584`'s merge (``|``) and update (``|=``) operators." msgstr "" -#: ../../library/os.rst:226 +#: ../../library/os.rst:231 msgid "" "Bytes version of :data:`environ`: a :term:`mapping` object where both keys " "and values are :class:`bytes` objects representing the process environment. :" @@ -389,47 +395,47 @@ msgid "" "`environb` updates :data:`environ`, and vice versa)." msgstr "" -#: ../../library/os.rst:231 +#: ../../library/os.rst:236 msgid "" ":data:`environb` is only available if :data:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:245 +#: ../../library/os.rst:250 msgid "These functions are described in :ref:`os-file-dir`." msgstr "" -#: ../../library/os.rst:250 +#: ../../library/os.rst:255 msgid "" "Encode :term:`path-like ` *filename* to the :term:" "`filesystem encoding and error handler`; return :class:`bytes` unchanged." msgstr "" -#: ../../library/os.rst:254 +#: ../../library/os.rst:259 msgid ":func:`fsdecode` is the reverse function." msgstr "" -#: ../../library/os.rst:258 ../../library/os.rst:273 +#: ../../library/os.rst:263 ../../library/os.rst:278 msgid "" "Support added to accept objects implementing the :class:`os.PathLike` " "interface." msgstr "" -#: ../../library/os.rst:265 +#: ../../library/os.rst:270 msgid "" "Decode the :term:`path-like ` *filename* from the :term:" "`filesystem encoding and error handler`; return :class:`str` unchanged." msgstr "" -#: ../../library/os.rst:269 +#: ../../library/os.rst:274 msgid ":func:`fsencode` is the reverse function." msgstr "" -#: ../../library/os.rst:280 +#: ../../library/os.rst:285 msgid "Return the file system representation of the path." msgstr "" -#: ../../library/os.rst:282 +#: ../../library/os.rst:287 msgid "" "If :class:`str` or :class:`bytes` is passed in, it is returned unchanged. " "Otherwise :meth:`~os.PathLike.__fspath__` is called and its value is " @@ -437,23 +443,23 @@ msgid "" "other cases, :exc:`TypeError` is raised." msgstr "" -#: ../../library/os.rst:292 +#: ../../library/os.rst:297 msgid "" "An :term:`abstract base class` for objects representing a file system path, " "e.g. :class:`pathlib.PurePath`." msgstr "" -#: ../../library/os.rst:299 +#: ../../library/os.rst:304 msgid "Return the file system path representation of the object." msgstr "" -#: ../../library/os.rst:301 +#: ../../library/os.rst:306 msgid "" "The method should only return a :class:`str` or :class:`bytes` object, with " "the preference being for :class:`str`." msgstr "" -#: ../../library/os.rst:307 +#: ../../library/os.rst:312 msgid "" "Return the value of the environment variable *key* as a string if it exists, " "or *default* if it doesn't. *key* is a string. Note that since :func:" @@ -462,24 +468,23 @@ msgid "" "changes." msgstr "" -#: ../../library/os.rst:313 +#: ../../library/os.rst:318 msgid "" "On Unix, keys and values are decoded with :func:`sys.getfilesystemencoding` " "and ``'surrogateescape'`` error handler. Use :func:`os.getenvb` if you would " "like to use a different encoding." msgstr "" -#: ../../library/os.rst:317 ../../library/os.rst:975 ../../library/os.rst:986 -#: ../../library/os.rst:1202 ../../library/os.rst:1637 -#: ../../library/os.rst:2034 ../../library/os.rst:2307 -#: ../../library/os.rst:3097 ../../library/os.rst:3134 -#: ../../library/os.rst:3749 ../../library/os.rst:4238 -#: ../../library/os.rst:4249 ../../library/os.rst:4366 -#, fuzzy +#: ../../library/os.rst:322 ../../library/os.rst:980 ../../library/os.rst:991 +#: ../../library/os.rst:1207 ../../library/os.rst:1642 +#: ../../library/os.rst:2039 ../../library/os.rst:2312 +#: ../../library/os.rst:3102 ../../library/os.rst:3139 +#: ../../library/os.rst:3754 ../../library/os.rst:4243 +#: ../../library/os.rst:4254 ../../library/os.rst:4371 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/os.rst:322 +#: ../../library/os.rst:327 msgid "" "Return the value of the environment variable *key* as bytes if it exists, or " "*default* if it doesn't. *key* must be bytes. Note that since :func:" @@ -488,32 +493,32 @@ msgid "" "environment changes." msgstr "" -#: ../../library/os.rst:329 +#: ../../library/os.rst:334 msgid "" ":func:`getenvb` is only available if :data:`supports_bytes_environ` is " "``True``." msgstr "" -#: ../../library/os.rst:332 ../../library/os.rst:371 ../../library/os.rst:517 -#: ../../library/os.rst:733 ../../library/os.rst:893 ../../library/os.rst:908 -#: ../../library/os.rst:919 ../../library/os.rst:942 ../../library/os.rst:963 -#: ../../library/os.rst:999 ../../library/os.rst:1023 ../../library/os.rst:1035 -#: ../../library/os.rst:1241 ../../library/os.rst:1256 -#: ../../library/os.rst:1269 ../../library/os.rst:1338 -#: ../../library/os.rst:1473 ../../library/os.rst:1548 -#: ../../library/os.rst:1575 ../../library/os.rst:1610 -#: ../../library/os.rst:1933 ../../library/os.rst:1964 -#: ../../library/os.rst:2005 ../../library/os.rst:2018 -#: ../../library/os.rst:2273 ../../library/os.rst:2285 -#: ../../library/os.rst:2963 ../../library/os.rst:3120 -#: ../../library/os.rst:3353 ../../library/os.rst:4856 -#: ../../library/os.rst:4865 ../../library/os.rst:4886 -#: ../../library/os.rst:4896 ../../library/os.rst:4905 -#, fuzzy +#: ../../library/os.rst:337 ../../library/os.rst:376 ../../library/os.rst:522 +#: ../../library/os.rst:738 ../../library/os.rst:898 ../../library/os.rst:913 +#: ../../library/os.rst:924 ../../library/os.rst:947 ../../library/os.rst:968 +#: ../../library/os.rst:1004 ../../library/os.rst:1028 +#: ../../library/os.rst:1040 ../../library/os.rst:1246 +#: ../../library/os.rst:1261 ../../library/os.rst:1274 +#: ../../library/os.rst:1343 ../../library/os.rst:1478 +#: ../../library/os.rst:1553 ../../library/os.rst:1580 +#: ../../library/os.rst:1615 ../../library/os.rst:1938 +#: ../../library/os.rst:1969 ../../library/os.rst:2010 +#: ../../library/os.rst:2023 ../../library/os.rst:2278 +#: ../../library/os.rst:2290 ../../library/os.rst:2968 +#: ../../library/os.rst:3125 ../../library/os.rst:3358 +#: ../../library/os.rst:4861 ../../library/os.rst:4870 +#: ../../library/os.rst:4891 ../../library/os.rst:4901 +#: ../../library/os.rst:4910 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/os.rst:339 +#: ../../library/os.rst:344 msgid "" "Returns the list of directories that will be searched for a named " "executable, similar to a shell, when launching a process. *env*, when " @@ -521,28 +526,28 @@ msgid "" "in. By default, when *env* is ``None``, :data:`environ` is used." msgstr "" -#: ../../library/os.rst:350 +#: ../../library/os.rst:355 msgid "" "Return the effective group id of the current process. This corresponds to " "the \"set id\" bit on the file being executed in the current process." msgstr "" -#: ../../library/os.rst:360 +#: ../../library/os.rst:365 msgid "Return the current process's effective user id." msgstr "" -#: ../../library/os.rst:369 +#: ../../library/os.rst:374 msgid "Return the real group id of the current process." msgstr "" -#: ../../library/os.rst:373 ../../library/os.rst:446 ../../library/os.rst:519 -#: ../../library/os.rst:704 +#: ../../library/os.rst:378 ../../library/os.rst:451 ../../library/os.rst:524 +#: ../../library/os.rst:709 msgid "" "The function is a stub on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." msgstr "" -#: ../../library/os.rst:379 +#: ../../library/os.rst:384 msgid "" "Return list of group ids that *user* belongs to. If *group* is not in the " "list, it is included; typically, *group* is specified as the group ID field " @@ -550,12 +555,12 @@ msgid "" "potentially omitted." msgstr "" -#: ../../library/os.rst:391 +#: ../../library/os.rst:396 msgid "" "Return list of supplemental group ids associated with the current process." msgstr "" -#: ../../library/os.rst:397 +#: ../../library/os.rst:402 msgid "" "On macOS, :func:`getgroups` behavior differs somewhat from other Unix " "platforms. If the Python interpreter was built with a deployment target of :" @@ -572,7 +577,7 @@ msgid "" "get_config_var`." msgstr "" -#: ../../library/os.rst:414 +#: ../../library/os.rst:419 msgid "" "Return the name of the user logged in on the controlling terminal of the " "process. For most purposes, it is more useful to use :func:`getpass." @@ -581,41 +586,40 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:421 ../../library/os.rst:457 ../../library/os.rst:3714 -#: ../../library/os.rst:3930 ../../library/os.rst:4219 -#: ../../library/os.rst:4343 ../../library/os.rst:4459 -#: ../../library/os.rst:4628 -#, fuzzy +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3719 +#: ../../library/os.rst:3935 ../../library/os.rst:4224 +#: ../../library/os.rst:4348 ../../library/os.rst:4464 +#: ../../library/os.rst:4633 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" -#: ../../library/os.rst:426 +#: ../../library/os.rst:431 msgid "" "Return the process group id of the process with process id *pid*. If *pid* " "is 0, the process group id of the current process is returned." msgstr "" -#: ../../library/os.rst:435 +#: ../../library/os.rst:440 msgid "Return the id of the current process group." msgstr "" -#: ../../library/os.rst:444 +#: ../../library/os.rst:449 msgid "Return the current process id." msgstr "" -#: ../../library/os.rst:453 +#: ../../library/os.rst:458 msgid "" "Return the parent's process id. When the parent process has exited, on Unix " "the id returned is the one of the init process (1), on Windows it is still " "the same id, which may be already reused by another process." msgstr "" -#: ../../library/os.rst:459 +#: ../../library/os.rst:464 msgid "Added support for Windows." msgstr "新增對 Windows 的支援。" -#: ../../library/os.rst:467 +#: ../../library/os.rst:472 msgid "" "Get program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -626,42 +630,42 @@ msgid "" "user ID of the calling process." msgstr "" -#: ../../library/os.rst:484 +#: ../../library/os.rst:489 msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:493 +#: ../../library/os.rst:498 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " "effective, and saved user ids." msgstr "" -#: ../../library/os.rst:503 +#: ../../library/os.rst:508 msgid "" "Return a tuple (rgid, egid, sgid) denoting the current process's real, " "effective, and saved group ids." msgstr "" -#: ../../library/os.rst:515 +#: ../../library/os.rst:520 msgid "Return the current process's real user id." msgstr "" -#: ../../library/os.rst:525 +#: ../../library/os.rst:530 msgid "" "Call the system initgroups() to initialize the group access list with all of " "the groups of which the specified username is a member, plus the specified " "group id." msgstr "" -#: ../../library/os.rst:538 +#: ../../library/os.rst:543 msgid "" "Set the environment variable named *key* to the string *value*. Such " "changes to the environment affect subprocesses started with :func:`os." "system`, :func:`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:542 +#: ../../library/os.rst:547 msgid "" "Assignments to items in :data:`os.environ` are automatically translated into " "corresponding calls to :func:`putenv`; however, calls to :func:`putenv` " @@ -671,7 +675,7 @@ msgid "" "in their implementations." msgstr "" -#: ../../library/os.rst:550 +#: ../../library/os.rst:555 msgid "" "On some platforms, including FreeBSD and macOS, setting ``environ`` may " "cause memory leaks. Refer to the system documentation for :c:func:`putenv`." @@ -683,23 +687,23 @@ msgid "" "``key``, ``value``." msgstr "" -#: ../../library/os.rst:555 +#: ../../library/os.rst:560 msgid "The function is now always available." msgstr "" -#: ../../library/os.rst:561 +#: ../../library/os.rst:566 msgid "Set the current process's effective group id." msgstr "" -#: ../../library/os.rst:568 +#: ../../library/os.rst:573 msgid "Set the current process's effective user id." msgstr "" -#: ../../library/os.rst:575 +#: ../../library/os.rst:580 msgid "Set the current process' group id." msgstr "" -#: ../../library/os.rst:582 +#: ../../library/os.rst:587 msgid "" "Set the list of supplemental group ids associated with the current process " "to *groups*. *groups* must be a sequence, and each element must be an " @@ -707,7 +711,7 @@ msgid "" "the superuser." msgstr "" -#: ../../library/os.rst:588 +#: ../../library/os.rst:593 msgid "" "On macOS, the length of *groups* may not exceed the system-defined maximum " "number of effective group ids, typically 16. See the documentation for :func:" @@ -715,21 +719,21 @@ msgid "" "calling setgroups()." msgstr "" -#: ../../library/os.rst:595 +#: ../../library/os.rst:600 msgid "" "Call the system call :c:func:`setpgrp` or ``setpgrp(0, 0)`` depending on " "which version is implemented (if any). See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:603 +#: ../../library/os.rst:608 msgid "" "Call the system call :c:func:`setpgid` to set the process group id of the " "process with id *pid* to the process group with id *pgrp*. See the Unix " "manual for the semantics." msgstr "" -#: ../../library/os.rst:614 +#: ../../library/os.rst:619 msgid "" "Set program scheduling priority. The value *which* is one of :const:" "`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " @@ -742,109 +746,109 @@ msgid "" "scheduling." msgstr "" -#: ../../library/os.rst:631 +#: ../../library/os.rst:636 msgid "Set the current process's real and effective group ids." msgstr "" -#: ../../library/os.rst:638 +#: ../../library/os.rst:643 msgid "Set the current process's real, effective, and saved group ids." msgstr "" -#: ../../library/os.rst:647 +#: ../../library/os.rst:652 msgid "Set the current process's real, effective, and saved user ids." msgstr "" -#: ../../library/os.rst:656 +#: ../../library/os.rst:661 msgid "Set the current process's real and effective user ids." msgstr "" -#: ../../library/os.rst:663 +#: ../../library/os.rst:668 msgid "" "Call the system call :c:func:`getsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:670 +#: ../../library/os.rst:675 msgid "" "Call the system call :c:func:`setsid`. See the Unix manual for the " "semantics." msgstr "" -#: ../../library/os.rst:679 +#: ../../library/os.rst:684 msgid "Set the current process's user id." msgstr "" -#: ../../library/os.rst:687 +#: ../../library/os.rst:692 msgid "" "Return the error message corresponding to the error code in *code*. On " "platforms where :c:func:`strerror` returns ``NULL`` when given an unknown " "error number, :exc:`ValueError` is raised." msgstr "" -#: ../../library/os.rst:694 +#: ../../library/os.rst:699 msgid "" "``True`` if the native OS type of the environment is bytes (eg. ``False`` on " "Windows)." msgstr "" -#: ../../library/os.rst:702 +#: ../../library/os.rst:707 msgid "Set the current numeric umask and return the previous umask." msgstr "" -#: ../../library/os.rst:714 +#: ../../library/os.rst:719 msgid "" "Returns information identifying the current operating system. The return " "value is an object with five attributes:" msgstr "" -#: ../../library/os.rst:717 +#: ../../library/os.rst:722 msgid ":attr:`sysname` - operating system name" msgstr ":attr:`sysname` - 作業系統名稱" -#: ../../library/os.rst:718 +#: ../../library/os.rst:723 msgid ":attr:`nodename` - name of machine on network (implementation-defined)" msgstr "" -#: ../../library/os.rst:719 +#: ../../library/os.rst:724 msgid ":attr:`release` - operating system release" msgstr "" -#: ../../library/os.rst:720 +#: ../../library/os.rst:725 msgid ":attr:`version` - operating system version" msgstr ":attr:`version` - 作業系統版本" -#: ../../library/os.rst:721 +#: ../../library/os.rst:726 msgid ":attr:`machine` - hardware identifier" msgstr "" -#: ../../library/os.rst:723 +#: ../../library/os.rst:728 msgid "" "For backwards compatibility, this object is also iterable, behaving like a " "five-tuple containing :attr:`sysname`, :attr:`nodename`, :attr:`release`, :" "attr:`version`, and :attr:`machine` in that order." msgstr "" -#: ../../library/os.rst:728 +#: ../../library/os.rst:733 msgid "" "Some systems truncate :attr:`nodename` to 8 characters or to the leading " "component; a better way to get the hostname is :func:`socket.gethostname` " "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:735 ../../library/os.rst:4368 +#: ../../library/os.rst:740 ../../library/os.rst:4373 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." msgstr "" -#: ../../library/os.rst:744 +#: ../../library/os.rst:749 msgid "" "Unset (delete) the environment variable named *key*. Such changes to the " "environment affect subprocesses started with :func:`os.system`, :func:" "`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: ../../library/os.rst:748 +#: ../../library/os.rst:753 msgid "" "Deletion of items in :data:`os.environ` is automatically translated into a " "corresponding call to :func:`unsetenv`; however, calls to :func:`unsetenv` " @@ -858,21 +862,21 @@ msgid "" "``key``." msgstr "" -#: ../../library/os.rst:755 +#: ../../library/os.rst:760 msgid "The function is now always available and is also available on Windows." msgstr "" -#: ../../library/os.rst:762 +#: ../../library/os.rst:767 msgid "File Object Creation" msgstr "" -#: ../../library/os.rst:764 +#: ../../library/os.rst:769 msgid "" "These functions create new :term:`file objects `. (See also :" "func:`~os.open` for opening file descriptors.)" msgstr "" -#: ../../library/os.rst:770 +#: ../../library/os.rst:775 msgid "" "Return an open file object connected to the file descriptor *fd*. This is " "an alias of the :func:`open` built-in function and accepts the same " @@ -880,16 +884,16 @@ msgid "" "must always be an integer." msgstr "" -#: ../../library/os.rst:779 +#: ../../library/os.rst:784 msgid "File Descriptor Operations" msgstr "" -#: ../../library/os.rst:781 +#: ../../library/os.rst:786 msgid "" "These functions operate on I/O streams referenced using file descriptors." msgstr "" -#: ../../library/os.rst:783 +#: ../../library/os.rst:788 msgid "" "File descriptors are small integers corresponding to a file that has been " "opened by the current process. For example, standard input is usually file " @@ -899,7 +903,7 @@ msgid "" "pipes are also referenced by file descriptors." msgstr "" -#: ../../library/os.rst:790 +#: ../../library/os.rst:795 msgid "" "The :meth:`~io.IOBase.fileno` method can be used to obtain the file " "descriptor associated with a :term:`file object` when required. Note that " @@ -907,11 +911,11 @@ msgid "" "ignoring aspects such as internal buffering of data." msgstr "" -#: ../../library/os.rst:798 +#: ../../library/os.rst:803 msgid "Close file descriptor *fd*." msgstr "" -#: ../../library/os.rst:802 +#: ../../library/os.rst:807 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To close a " @@ -919,13 +923,13 @@ msgid "" "`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" -#: ../../library/os.rst:810 +#: ../../library/os.rst:815 msgid "" "Close all file descriptors from *fd_low* (inclusive) to *fd_high* " "(exclusive), ignoring errors. Equivalent to (but much faster than)::" msgstr "" -#: ../../library/os.rst:822 +#: ../../library/os.rst:827 msgid "" "Copy *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -935,7 +939,7 @@ msgid "" "attr:`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:829 ../../library/os.rst:1513 +#: ../../library/os.rst:834 ../../library/os.rst:1518 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -943,53 +947,53 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:834 +#: ../../library/os.rst:839 msgid "" "The return value is the amount of bytes copied. This could be less than the " "amount requested." msgstr "" -#: ../../library/os.rst:837 +#: ../../library/os.rst:842 msgid ":ref:`Availability `: Linux >= 4.5 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 4.5 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:844 +#: ../../library/os.rst:849 msgid "" "Return a string describing the encoding of the device associated with *fd* " "if it is connected to a terminal; else return :const:`None`." msgstr "" -#: ../../library/os.rst:847 +#: ../../library/os.rst:852 msgid "" "On Unix, if the :ref:`Python UTF-8 Mode ` is enabled, return " "``'UTF-8'`` rather than the device encoding." msgstr "" -#: ../../library/os.rst:850 +#: ../../library/os.rst:855 msgid "On Unix, the function now implements the Python UTF-8 Mode." msgstr "" -#: ../../library/os.rst:856 +#: ../../library/os.rst:861 msgid "" "Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" "`non-inheritable `." msgstr "" -#: ../../library/os.rst:859 +#: ../../library/os.rst:864 msgid "" "On Windows, when duplicating a standard stream (0: stdin, 1: stdout, 2: " "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: ../../library/os.rst:863 ../../library/os.rst:876 +#: ../../library/os.rst:868 ../../library/os.rst:881 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/os.rst:865 ../../library/os.rst:1089 +#: ../../library/os.rst:870 ../../library/os.rst:1094 msgid "The new file descriptor is now non-inheritable." msgstr "" -#: ../../library/os.rst:871 +#: ../../library/os.rst:876 msgid "" "Duplicate file descriptor *fd* to *fd2*, closing the latter first if " "necessary. Return *fd2*. The new file descriptor is :ref:`inheritable " @@ -997,15 +1001,15 @@ msgid "" "``False``." msgstr "" -#: ../../library/os.rst:878 +#: ../../library/os.rst:883 msgid "Add the optional *inheritable* parameter." msgstr "" -#: ../../library/os.rst:881 +#: ../../library/os.rst:886 msgid "Return *fd2* on success. Previously, ``None`` was always returned." msgstr "" -#: ../../library/os.rst:887 +#: ../../library/os.rst:892 msgid "" "Change the mode of the file given by *fd* to the numeric *mode*. See the " "docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, " @@ -1018,15 +1022,15 @@ msgid "" "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:895 ../../library/os.rst:910 ../../library/os.rst:1001 -#: ../../library/os.rst:1475 ../../library/os.rst:1906 -#: ../../library/os.rst:1935 ../../library/os.rst:3099 +#: ../../library/os.rst:900 ../../library/os.rst:915 ../../library/os.rst:1006 +#: ../../library/os.rst:1480 ../../library/os.rst:1911 +#: ../../library/os.rst:1940 ../../library/os.rst:3104 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." msgstr "" -#: ../../library/os.rst:901 +#: ../../library/os.rst:906 msgid "" "Change the owner and group id of the file given by *fd* to the numeric *uid* " "and *gid*. To leave one of the ids unchanged, set it to -1. See :func:" @@ -1039,17 +1043,17 @@ msgid "" "``path``, ``uid``, ``gid``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:916 +#: ../../library/os.rst:921 msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -#: ../../library/os.rst:922 +#: ../../library/os.rst:927 msgid "This function is not available on MacOS." msgstr "" -#: ../../library/os.rst:927 +#: ../../library/os.rst:932 msgid "" "Return system configuration information relevant to an open file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -1060,7 +1064,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:935 ../../library/os.rst:2265 +#: ../../library/os.rst:940 ../../library/os.rst:2270 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1068,46 +1072,46 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:940 +#: ../../library/os.rst:945 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." msgstr "" -#: ../../library/os.rst:947 +#: ../../library/os.rst:952 msgid "" "Get the status of the file descriptor *fd*. Return a :class:`stat_result` " "object." msgstr "" -#: ../../library/os.rst:950 +#: ../../library/os.rst:955 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:954 ../../library/os.rst:2100 +#: ../../library/os.rst:959 ../../library/os.rst:2105 msgid "The :func:`.stat` function." msgstr "" -#: ../../library/os.rst:959 +#: ../../library/os.rst:964 msgid "" "Return information about the filesystem containing the file associated with " "file descriptor *fd*, like :func:`statvfs`. As of Python 3.3, this is " "equivalent to ``os.statvfs(fd)``." msgstr "" -#: ../../library/os.rst:968 +#: ../../library/os.rst:973 msgid "" "Force write of file with filedescriptor *fd* to disk. On Unix, this calls " "the native :c:func:`fsync` function; on Windows, the MS :c:func:`_commit` " "function." msgstr "" -#: ../../library/os.rst:971 +#: ../../library/os.rst:976 msgid "" "If you're starting with a buffered Python :term:`file object` *f*, first do " "``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all " "internal buffers associated with *f* are written to disk." msgstr "" -#: ../../library/os.rst:980 +#: ../../library/os.rst:985 msgid "" "Truncate the file corresponding to file descriptor *fd*, so that it is at " "most *length* bytes in size. As of Python 3.3, this is equivalent to ``os." @@ -1120,28 +1124,28 @@ msgid "" "``fd``, ``length``." msgstr "" -#: ../../library/os.rst:988 ../../library/os.rst:3138 +#: ../../library/os.rst:993 ../../library/os.rst:3143 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" -#: ../../library/os.rst:994 +#: ../../library/os.rst:999 msgid "" "Get the blocking mode of the file descriptor: ``False`` if the :data:" "`O_NONBLOCK` flag is set, ``True`` if the flag is cleared." msgstr "" -#: ../../library/os.rst:997 +#: ../../library/os.rst:1002 msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1009 +#: ../../library/os.rst:1014 msgid "" "Return ``True`` if the file descriptor *fd* is open and connected to a tty(-" "like) device, else ``False``." msgstr "" -#: ../../library/os.rst:1015 +#: ../../library/os.rst:1020 msgid "" "Apply, test or remove a POSIX lock on an open file descriptor. *fd* is an " "open file descriptor. *cmd* specifies the command to use - one of :data:" @@ -1155,18 +1159,18 @@ msgid "" "``fd``, ``cmd``, ``len``." msgstr "" -#: ../../library/os.rst:1033 +#: ../../library/os.rst:1038 msgid "Flags that specify what action :func:`lockf` will take." msgstr "" -#: ../../library/os.rst:1042 +#: ../../library/os.rst:1047 msgid "" "Prepare the tty of which fd is a file descriptor for a new login session. " "Make the calling process a session leader; make the tty the controlling tty, " "the stdin, the stdout, and the stderr of the calling process; close fd." msgstr "" -#: ../../library/os.rst:1053 +#: ../../library/os.rst:1058 msgid "" "Set the current position of file descriptor *fd* to position *pos*, modified " "by *how*: :const:`SEEK_SET` or ``0`` to set the position relative to the " @@ -1176,19 +1180,19 @@ msgid "" "beginning." msgstr "" -#: ../../library/os.rst:1064 +#: ../../library/os.rst:1069 msgid "" "Parameters to the :func:`lseek` function. Their values are 0, 1, and 2, " "respectively." msgstr "" -#: ../../library/os.rst:1067 +#: ../../library/os.rst:1072 msgid "" "Some operating systems could support additional values, like :data:`os." "SEEK_HOLE` or :data:`os.SEEK_DATA`." msgstr "" -#: ../../library/os.rst:1074 +#: ../../library/os.rst:1079 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " "its mode according to *mode*. When computing *mode*, the current umask " @@ -1196,7 +1200,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:1079 +#: ../../library/os.rst:1084 msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " @@ -1204,7 +1208,7 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: ../../library/os.rst:1084 +#: ../../library/os.rst:1089 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." @@ -1216,7 +1220,7 @@ msgid "" "``mode``, ``flags``." msgstr "" -#: ../../library/os.rst:1094 +#: ../../library/os.rst:1099 msgid "" "This function is intended for low-level I/O. For normal usage, use the " "built-in function :func:`open`, which returns a :term:`file object` with :" @@ -1224,39 +1228,39 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1099 ../../library/os.rst:2141 -#: ../../library/os.rst:2209 ../../library/os.rst:2231 -#: ../../library/os.rst:2312 ../../library/os.rst:2343 +#: ../../library/os.rst:1104 ../../library/os.rst:2146 +#: ../../library/os.rst:2214 ../../library/os.rst:2236 +#: ../../library/os.rst:2317 ../../library/os.rst:2348 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" -#: ../../library/os.rst:1102 ../../library/os.rst:1421 -#: ../../library/os.rst:1592 ../../library/os.rst:4461 +#: ../../library/os.rst:1107 ../../library/os.rst:1426 +#: ../../library/os.rst:1597 ../../library/os.rst:4466 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1107 ../../library/os.rst:1803 -#: ../../library/os.rst:1835 ../../library/os.rst:1866 -#: ../../library/os.rst:1915 ../../library/os.rst:1952 -#: ../../library/os.rst:1992 ../../library/os.rst:2007 -#: ../../library/os.rst:2020 ../../library/os.rst:2079 -#: ../../library/os.rst:2108 ../../library/os.rst:2144 -#: ../../library/os.rst:2185 ../../library/os.rst:2212 -#: ../../library/os.rst:2234 ../../library/os.rst:2275 -#: ../../library/os.rst:2346 ../../library/os.rst:2365 -#: ../../library/os.rst:2453 ../../library/os.rst:2726 -#: ../../library/os.rst:2977 ../../library/os.rst:3141 -#: ../../library/os.rst:3157 ../../library/os.rst:3197 -#: ../../library/os.rst:3296 ../../library/os.rst:3357 -#: ../../library/os.rst:3541 ../../library/os.rst:3720 -#: ../../library/os.rst:4226 +#: ../../library/os.rst:1112 ../../library/os.rst:1808 +#: ../../library/os.rst:1840 ../../library/os.rst:1871 +#: ../../library/os.rst:1920 ../../library/os.rst:1957 +#: ../../library/os.rst:1997 ../../library/os.rst:2012 +#: ../../library/os.rst:2025 ../../library/os.rst:2084 +#: ../../library/os.rst:2113 ../../library/os.rst:2149 +#: ../../library/os.rst:2190 ../../library/os.rst:2217 +#: ../../library/os.rst:2239 ../../library/os.rst:2280 +#: ../../library/os.rst:2351 ../../library/os.rst:2370 +#: ../../library/os.rst:2458 ../../library/os.rst:2731 +#: ../../library/os.rst:2982 ../../library/os.rst:3146 +#: ../../library/os.rst:3162 ../../library/os.rst:3202 +#: ../../library/os.rst:3301 ../../library/os.rst:3362 +#: ../../library/os.rst:3546 ../../library/os.rst:3725 +#: ../../library/os.rst:4231 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1110 +#: ../../library/os.rst:1115 msgid "" "The following constants are options for the *flags* parameter to the :func:" "`~os.open` function. They can be combined using the bitwise OR operator ``|" @@ -1266,45 +1270,45 @@ msgid "" "on Windows." msgstr "" -#: ../../library/os.rst:1125 +#: ../../library/os.rst:1130 msgid "The above constants are available on Unix and Windows." msgstr "" -#: ../../library/os.rst:1136 +#: ../../library/os.rst:1141 msgid "The above constants are only available on Unix." msgstr "" -#: ../../library/os.rst:1138 +#: ../../library/os.rst:1143 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: ../../library/os.rst:1149 +#: ../../library/os.rst:1154 msgid "The above constants are only available on Windows." msgstr "" -#: ../../library/os.rst:1156 +#: ../../library/os.rst:1161 msgid "The above constants are only available on macOS." msgstr "" -#: ../../library/os.rst:1158 +#: ../../library/os.rst:1163 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: ../../library/os.rst:1172 +#: ../../library/os.rst:1177 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: ../../library/os.rst:1175 +#: ../../library/os.rst:1180 msgid "" "Add :data:`O_PATH` on systems that support it. Add :data:`O_TMPFILE`, only " "available on Linux Kernel 3.11 or newer." msgstr "" -#: ../../library/os.rst:1185 +#: ../../library/os.rst:1190 msgid "" "Open a new pseudo-terminal pair. Return a pair of file descriptors " "``(master, slave)`` for the pty and the tty, respectively. The new file " @@ -1312,18 +1316,18 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: ../../library/os.rst:1192 ../../library/os.rst:1204 +#: ../../library/os.rst:1197 ../../library/os.rst:1209 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: ../../library/os.rst:1198 +#: ../../library/os.rst:1203 msgid "" "Create a pipe. Return a pair of file descriptors ``(r, w)`` usable for " "reading and writing, respectively. The new file descriptor is :ref:`non-" "inheritable `." msgstr "" -#: ../../library/os.rst:1210 +#: ../../library/os.rst:1215 msgid "" "Create a pipe with *flags* set atomically. *flags* can be constructed by " "ORing together one or more of these values: :data:`O_NONBLOCK`, :data:" @@ -1331,17 +1335,17 @@ msgid "" "and writing, respectively." msgstr "" -#: ../../library/os.rst:1223 +#: ../../library/os.rst:1228 msgid "" "Ensures that enough disk space is allocated for the file specified by *fd* " "starting from *offset* and continuing for *len* bytes." msgstr "" -#: ../../library/os.rst:1226 +#: ../../library/os.rst:1231 msgid ":ref:`Availability `: Unix, not Emscripten." msgstr ":ref:`適用 `:Unix、非 Emscripten。" -#: ../../library/os.rst:1233 +#: ../../library/os.rst:1238 msgid "" "Announces an intention to access data in a specific pattern thus allowing " "the kernel to make optimizations. The advice applies to the region of the " @@ -1352,25 +1356,25 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: ../../library/os.rst:1253 +#: ../../library/os.rst:1258 msgid "" "Flags that can be used in *advice* in :func:`posix_fadvise` that specify the " "access pattern that is likely to be used." msgstr "" -#: ../../library/os.rst:1263 +#: ../../library/os.rst:1268 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1266 ../../library/os.rst:1410 +#: ../../library/os.rst:1271 ../../library/os.rst:1415 msgid "" "Return a bytestring containing the bytes read. If the end of the file " "referred to by *fd* has been reached, an empty bytes object is returned." msgstr "" -#: ../../library/os.rst:1276 +#: ../../library/os.rst:1281 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1378,39 +1382,38 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: ../../library/os.rst:1281 ../../library/os.rst:1351 +#: ../../library/os.rst:1286 ../../library/os.rst:1356 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: ../../library/os.rst:1284 +#: ../../library/os.rst:1289 msgid ":data:`RWF_HIPRI`" msgstr ":data:`RWF_HIPRI`" -#: ../../library/os.rst:1285 +#: ../../library/os.rst:1290 msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1287 ../../library/os.rst:1542 +#: ../../library/os.rst:1292 ../../library/os.rst:1547 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" -#: ../../library/os.rst:1290 ../../library/os.rst:1360 -#: ../../library/os.rst:1545 ../../library/os.rst:1607 +#: ../../library/os.rst:1295 ../../library/os.rst:1365 +#: ../../library/os.rst:1550 ../../library/os.rst:1612 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." msgstr "" -#: ../../library/os.rst:1293 +#: ../../library/os.rst:1298 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1295 ../../library/os.rst:1365 -#, fuzzy +#: ../../library/os.rst:1300 ../../library/os.rst:1370 msgid "" ":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " ">= 2.7, AIX >= 7.1." @@ -1418,55 +1421,55 @@ msgstr "" ":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " "以上、AIX 7.1 以上。" -#: ../../library/os.rst:1297 ../../library/os.rst:1367 +#: ../../library/os.rst:1302 ../../library/os.rst:1372 msgid "Using flags requires Linux >= 4.6." msgstr "" -#: ../../library/os.rst:1304 +#: ../../library/os.rst:1309 msgid "" "Do not wait for data which is not immediately available. If this flag is " "specified, the system call will return instantly if it would have to read " "data from the backing storage or wait for a lock." msgstr "" -#: ../../library/os.rst:1308 +#: ../../library/os.rst:1313 msgid "" "If some data was successfully read, it will return the number of bytes read. " "If no bytes were read, it will return ``-1`` and set errno to :data:`errno." "EAGAIN`." msgstr "" -#: ../../library/os.rst:1312 +#: ../../library/os.rst:1317 msgid ":ref:`Availability `: Linux >= 4.14." msgstr ":ref:`適用 `:Linux 4.14 以上。" -#: ../../library/os.rst:1319 +#: ../../library/os.rst:1324 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " "the device, which provides lower latency, but may use additional resources." msgstr "" -#: ../../library/os.rst:1323 +#: ../../library/os.rst:1328 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1326 +#: ../../library/os.rst:1331 msgid ":ref:`Availability `: Linux >= 4.6." msgstr ":ref:`適用 `:Linux 4.6 以上。" -#: ../../library/os.rst:1333 +#: ../../library/os.rst:1338 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1336 ../../library/os.rst:1582 +#: ../../library/os.rst:1341 ../../library/os.rst:1587 msgid "Return the number of bytes actually written." msgstr "" -#: ../../library/os.rst:1345 +#: ../../library/os.rst:1350 msgid "" "Write the *buffers* contents to file descriptor *fd* at a offset *offset*, " "leaving the file offset unchanged. *buffers* must be a sequence of :term:" @@ -1475,43 +1478,43 @@ msgid "" "the second, and so on." msgstr "" -#: ../../library/os.rst:1354 +#: ../../library/os.rst:1359 msgid ":data:`RWF_DSYNC`" msgstr ":data:`RWF_DSYNC`" -#: ../../library/os.rst:1355 +#: ../../library/os.rst:1360 msgid ":data:`RWF_SYNC`" msgstr ":data:`RWF_SYNC`" -#: ../../library/os.rst:1356 +#: ../../library/os.rst:1361 msgid ":data:`RWF_APPEND`" msgstr ":data:`RWF_APPEND`" -#: ../../library/os.rst:1358 +#: ../../library/os.rst:1363 msgid "Return the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1363 +#: ../../library/os.rst:1368 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: ../../library/os.rst:1374 +#: ../../library/os.rst:1379 msgid "" "Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1377 ../../library/os.rst:1387 +#: ../../library/os.rst:1382 ../../library/os.rst:1392 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux 4.7 以上。" -#: ../../library/os.rst:1384 +#: ../../library/os.rst:1389 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1394 +#: ../../library/os.rst:1399 msgid "" "Provide a per-write equivalent of the :data:`O_APPEND` :func:`os.open` flag. " "This flag is meaningful only for :func:`os.pwritev`, and its effect applies " @@ -1521,15 +1524,15 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1401 +#: ../../library/os.rst:1406 msgid ":ref:`Availability `: Linux >= 4.16." msgstr ":ref:`適用 `:Linux 4.16 以上。" -#: ../../library/os.rst:1408 +#: ../../library/os.rst:1413 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1415 +#: ../../library/os.rst:1420 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To read a \"file " @@ -1538,26 +1541,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: ../../library/os.rst:1430 +#: ../../library/os.rst:1435 msgid "" "Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* " "starting at *offset*. Return the number of bytes sent. When EOF is reached " "return ``0``." msgstr "" -#: ../../library/os.rst:1434 +#: ../../library/os.rst:1439 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: ../../library/os.rst:1437 +#: ../../library/os.rst:1442 msgid "" "On Linux, if *offset* is given as ``None``, the bytes are read from the " "current position of *in_fd* and the position of *in_fd* is updated." msgstr "" -#: ../../library/os.rst:1440 +#: ../../library/os.rst:1445 msgid "" "The second case may be used on macOS and FreeBSD where *headers* and " "*trailers* are arbitrary sequences of buffers that are written before and " @@ -1565,59 +1568,59 @@ msgid "" "case." msgstr "" -#: ../../library/os.rst:1444 +#: ../../library/os.rst:1449 msgid "" "On macOS and FreeBSD, a value of ``0`` for *count* specifies to send until " "the end of *in_fd* is reached." msgstr "" -#: ../../library/os.rst:1447 +#: ../../library/os.rst:1452 msgid "" "All platforms support sockets as *out_fd* file descriptor, and some " "platforms allow other types (e.g. regular file, pipe) as well." msgstr "" -#: ../../library/os.rst:1450 +#: ../../library/os.rst:1455 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: ../../library/os.rst:1457 +#: ../../library/os.rst:1462 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: ../../library/os.rst:1462 +#: ../../library/os.rst:1467 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1468 +#: ../../library/os.rst:1473 msgid "" "Set the blocking mode of the specified file descriptor. Set the :data:" "`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." msgstr "" -#: ../../library/os.rst:1471 +#: ../../library/os.rst:1476 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1485 +#: ../../library/os.rst:1490 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1494 +#: ../../library/os.rst:1499 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1504 +#: ../../library/os.rst:1509 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1629,7 +1632,7 @@ msgid "" "`~OSError.errno` set to :data:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1518 +#: ../../library/os.rst:1523 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1638,11 +1641,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1524 +#: ../../library/os.rst:1529 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1537 +#: ../../library/os.rst:1542 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1650,34 +1653,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1555 +#: ../../library/os.rst:1560 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: ../../library/os.rst:1558 ../../library/os.rst:1566 +#: ../../library/os.rst:1563 ../../library/os.rst:1571 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1563 +#: ../../library/os.rst:1568 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: ../../library/os.rst:1571 +#: ../../library/os.rst:1576 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: ../../library/os.rst:1580 +#: ../../library/os.rst:1585 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1586 +#: ../../library/os.rst:1591 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1686,7 +1689,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1600 +#: ../../library/os.rst:1605 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1694,70 +1697,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1605 +#: ../../library/os.rst:1610 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1618 +#: ../../library/os.rst:1623 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1624 +#: ../../library/os.rst:1629 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1627 +#: ../../library/os.rst:1632 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1630 +#: ../../library/os.rst:1635 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1633 +#: ../../library/os.rst:1638 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: ../../library/os.rst:1641 +#: ../../library/os.rst:1646 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1645 +#: ../../library/os.rst:1650 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1649 +#: ../../library/os.rst:1654 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1655 +#: ../../library/os.rst:1660 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1659 +#: ../../library/os.rst:1664 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: ../../library/os.rst:1663 +#: ../../library/os.rst:1668 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: ../../library/os.rst:1666 +#: ../../library/os.rst:1671 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1768,46 +1771,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1674 +#: ../../library/os.rst:1679 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1679 +#: ../../library/os.rst:1684 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1683 +#: ../../library/os.rst:1688 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1687 +#: ../../library/os.rst:1692 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1689 ../../library/os.rst:1695 -#: ../../library/os.rst:3646 ../../library/os.rst:4261 -#: ../../library/os.rst:4306 +#: ../../library/os.rst:1694 ../../library/os.rst:1700 +#: ../../library/os.rst:3651 ../../library/os.rst:4266 +#: ../../library/os.rst:4311 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1693 +#: ../../library/os.rst:1698 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1701 +#: ../../library/os.rst:1706 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1703 +#: ../../library/os.rst:1708 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1708 +#: ../../library/os.rst:1713 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -1818,7 +1821,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1716 +#: ../../library/os.rst:1721 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -1826,13 +1829,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1721 +#: ../../library/os.rst:1726 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:1726 +#: ../../library/os.rst:1731 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -1843,14 +1846,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1733 +#: ../../library/os.rst:1738 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1739 +#: ../../library/os.rst:1744 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -1859,14 +1862,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1745 +#: ../../library/os.rst:1750 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1753 +#: ../../library/os.rst:1758 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -1878,13 +1881,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1762 +#: ../../library/os.rst:1767 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1765 +#: ../../library/os.rst:1770 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -1893,7 +1896,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1773 +#: ../../library/os.rst:1778 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -1902,39 +1905,39 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1784 +#: ../../library/os.rst:1789 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1796 +#: ../../library/os.rst:1801 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:1800 +#: ../../library/os.rst:1805 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1812 +#: ../../library/os.rst:1817 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:1821 +#: ../../library/os.rst:1826 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1823 +#: ../../library/os.rst:1828 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:1826 +#: ../../library/os.rst:1831 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." @@ -1946,67 +1949,67 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:1831 +#: ../../library/os.rst:1836 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:1841 +#: ../../library/os.rst:1846 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:1844 +#: ../../library/os.rst:1849 msgid ":data:`stat.UF_NODUMP`" msgstr ":data:`stat.UF_NODUMP`" -#: ../../library/os.rst:1845 +#: ../../library/os.rst:1850 msgid ":data:`stat.UF_IMMUTABLE`" msgstr ":data:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:1846 +#: ../../library/os.rst:1851 msgid ":data:`stat.UF_APPEND`" msgstr ":data:`stat.UF_APPEND`" -#: ../../library/os.rst:1847 +#: ../../library/os.rst:1852 msgid ":data:`stat.UF_OPAQUE`" msgstr ":data:`stat.UF_OPAQUE`" -#: ../../library/os.rst:1848 +#: ../../library/os.rst:1853 msgid ":data:`stat.UF_NOUNLINK`" msgstr ":data:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:1849 +#: ../../library/os.rst:1854 msgid ":data:`stat.UF_COMPRESSED`" msgstr ":data:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:1850 +#: ../../library/os.rst:1855 msgid ":data:`stat.UF_HIDDEN`" msgstr ":data:`stat.UF_HIDDEN`" -#: ../../library/os.rst:1851 +#: ../../library/os.rst:1856 msgid ":data:`stat.SF_ARCHIVED`" msgstr ":data:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1857 msgid ":data:`stat.SF_IMMUTABLE`" msgstr ":data:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:1853 +#: ../../library/os.rst:1858 msgid ":data:`stat.SF_APPEND`" msgstr ":data:`stat.SF_APPEND`" -#: ../../library/os.rst:1854 +#: ../../library/os.rst:1859 msgid ":data:`stat.SF_NOUNLINK`" msgstr ":data:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:1855 +#: ../../library/os.rst:1860 msgid ":data:`stat.SF_SNAPSHOT`" msgstr ":data:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:1857 +#: ../../library/os.rst:1862 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" @@ -2017,164 +2020,164 @@ msgid "" "``path``, ``flags``." msgstr "" -#: ../../library/os.rst:1863 +#: ../../library/os.rst:1868 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:1872 +#: ../../library/os.rst:1877 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:1876 +#: ../../library/os.rst:1881 msgid ":data:`stat.S_ISUID`" msgstr ":data:`stat.S_ISUID`" -#: ../../library/os.rst:1877 +#: ../../library/os.rst:1882 msgid ":data:`stat.S_ISGID`" msgstr ":data:`stat.S_ISGID`" -#: ../../library/os.rst:1878 +#: ../../library/os.rst:1883 msgid ":data:`stat.S_ENFMT`" msgstr ":data:`stat.S_ENFMT`" -#: ../../library/os.rst:1879 +#: ../../library/os.rst:1884 msgid ":data:`stat.S_ISVTX`" msgstr ":data:`stat.S_ISVTX`" -#: ../../library/os.rst:1880 +#: ../../library/os.rst:1885 msgid ":data:`stat.S_IREAD`" msgstr ":data:`stat.S_IREAD`" -#: ../../library/os.rst:1881 +#: ../../library/os.rst:1886 msgid ":data:`stat.S_IWRITE`" msgstr ":data:`stat.S_IWRITE`" -#: ../../library/os.rst:1882 +#: ../../library/os.rst:1887 msgid ":data:`stat.S_IEXEC`" msgstr ":data:`stat.S_IEXEC`" -#: ../../library/os.rst:1883 +#: ../../library/os.rst:1888 msgid ":data:`stat.S_IRWXU`" msgstr ":data:`stat.S_IRWXU`" -#: ../../library/os.rst:1884 +#: ../../library/os.rst:1889 msgid ":data:`stat.S_IRUSR`" msgstr ":data:`stat.S_IRUSR`" -#: ../../library/os.rst:1885 +#: ../../library/os.rst:1890 msgid ":data:`stat.S_IWUSR`" msgstr ":data:`stat.S_IWUSR`" -#: ../../library/os.rst:1886 +#: ../../library/os.rst:1891 msgid ":data:`stat.S_IXUSR`" msgstr ":data:`stat.S_IXUSR`" -#: ../../library/os.rst:1887 +#: ../../library/os.rst:1892 msgid ":data:`stat.S_IRWXG`" msgstr ":data:`stat.S_IRWXG`" -#: ../../library/os.rst:1888 +#: ../../library/os.rst:1893 msgid ":data:`stat.S_IRGRP`" msgstr ":data:`stat.S_IRGRP`" -#: ../../library/os.rst:1889 +#: ../../library/os.rst:1894 msgid ":data:`stat.S_IWGRP`" msgstr ":data:`stat.S_IWGRP`" -#: ../../library/os.rst:1890 +#: ../../library/os.rst:1895 msgid ":data:`stat.S_IXGRP`" msgstr ":data:`stat.S_IXGRP`" -#: ../../library/os.rst:1891 +#: ../../library/os.rst:1896 msgid ":data:`stat.S_IRWXO`" msgstr ":data:`stat.S_IRWXO`" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:1897 msgid ":data:`stat.S_IROTH`" msgstr ":data:`stat.S_IROTH`" -#: ../../library/os.rst:1893 +#: ../../library/os.rst:1898 msgid ":data:`stat.S_IWOTH`" msgstr ":data:`stat.S_IWOTH`" -#: ../../library/os.rst:1894 +#: ../../library/os.rst:1899 msgid ":data:`stat.S_IXOTH`" msgstr ":data:`stat.S_IXOTH`" -#: ../../library/os.rst:1896 ../../library/os.rst:1924 -#: ../../library/os.rst:3187 +#: ../../library/os.rst:1901 ../../library/os.rst:1929 +#: ../../library/os.rst:3192 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:1902 +#: ../../library/os.rst:1907 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " "or a corresponding integer value). All other bits are ignored." msgstr "" -#: ../../library/os.rst:1911 ../../library/os.rst:1938 +#: ../../library/os.rst:1916 ../../library/os.rst:1943 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:1921 +#: ../../library/os.rst:1926 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:1928 +#: ../../library/os.rst:1933 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:1942 +#: ../../library/os.rst:1947 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:1948 +#: ../../library/os.rst:1953 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:1958 +#: ../../library/os.rst:1963 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:1969 +#: ../../library/os.rst:1974 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:1974 +#: ../../library/os.rst:1979 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:1976 +#: ../../library/os.rst:1981 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:1984 +#: ../../library/os.rst:1989 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:1998 +#: ../../library/os.rst:2003 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2182,18 +2185,18 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2017 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2026 +#: ../../library/os.rst:2031 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2028 +#: ../../library/os.rst:2033 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" @@ -2206,20 +2209,20 @@ msgid "" "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:2036 +#: ../../library/os.rst:2041 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2039 +#: ../../library/os.rst:2044 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "增加 *src_dir_fd*\\ 、\\ *dst_dir_fd* 與 *follow_symlinks* 引數。" -#: ../../library/os.rst:2042 ../../library/os.rst:2397 -#: ../../library/os.rst:2434 ../../library/os.rst:3109 +#: ../../library/os.rst:2047 ../../library/os.rst:2402 +#: ../../library/os.rst:2439 ../../library/os.rst:3114 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2048 +#: ../../library/os.rst:2053 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2228,7 +2231,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2054 +#: ../../library/os.rst:2059 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2236,7 +2239,7 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2059 ../../library/os.rst:2482 +#: ../../library/os.rst:2064 ../../library/os.rst:2487 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." @@ -2248,61 +2251,61 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:2065 +#: ../../library/os.rst:2070 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2069 +#: ../../library/os.rst:2074 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:2073 +#: ../../library/os.rst:2078 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2076 ../../library/os.rst:2968 +#: ../../library/os.rst:2081 ../../library/os.rst:2973 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2085 +#: ../../library/os.rst:2090 msgid "" "Perform the equivalent of an :c:func:`lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:2089 +#: ../../library/os.rst:2094 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2092 +#: ../../library/os.rst:2097 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2095 ../../library/os.rst:2133 -#: ../../library/os.rst:2198 ../../library/os.rst:2226 -#: ../../library/os.rst:2300 +#: ../../library/os.rst:2100 ../../library/os.rst:2138 +#: ../../library/os.rst:2203 ../../library/os.rst:2231 +#: ../../library/os.rst:2305 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2102 ../../library/os.rst:2309 -#: ../../library/os.rst:3102 +#: ../../library/os.rst:2107 ../../library/os.rst:2314 +#: ../../library/os.rst:3107 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2105 +#: ../../library/os.rst:2110 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2111 +#: ../../library/os.rst:2116 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2310,18 +2313,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2120 +#: ../../library/os.rst:2125 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2122 +#: ../../library/os.rst:2127 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: ../../library/os.rst:2127 +#: ../../library/os.rst:2132 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2330,7 +2333,7 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2136 +#: ../../library/os.rst:2141 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." @@ -2342,13 +2345,13 @@ msgid "" "``path``, ``mode``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2154 +#: ../../library/os.rst:2159 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2157 +#: ../../library/os.rst:2162 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2357,27 +2360,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2163 +#: ../../library/os.rst:2168 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2168 +#: ../../library/os.rst:2173 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2171 +#: ../../library/os.rst:2176 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2175 +#: ../../library/os.rst:2180 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2180 +#: ../../library/os.rst:2185 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2385,19 +2388,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2188 +#: ../../library/os.rst:2193 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2195 +#: ../../library/os.rst:2200 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:2201 +#: ../../library/os.rst:2206 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2407,7 +2410,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2218 +#: ../../library/os.rst:2223 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2418,23 +2421,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2240 +#: ../../library/os.rst:2245 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2246 +#: ../../library/os.rst:2251 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:type:`stat`)." msgstr "" -#: ../../library/os.rst:2252 +#: ../../library/os.rst:2257 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2257 +#: ../../library/os.rst:2262 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2445,20 +2448,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2270 ../../library/os.rst:2961 -#: ../../library/os.rst:3130 +#: ../../library/os.rst:2275 ../../library/os.rst:2966 +#: ../../library/os.rst:3135 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2281 +#: ../../library/os.rst:2286 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2290 +#: ../../library/os.rst:2295 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2466,7 +2469,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2295 +#: ../../library/os.rst:2300 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2474,42 +2477,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2303 +#: ../../library/os.rst:2308 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2315 +#: ../../library/os.rst:2320 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2318 +#: ../../library/os.rst:2323 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2321 +#: ../../library/os.rst:2326 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2328 +#: ../../library/os.rst:2333 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2332 ../../library/os.rst:2445 -#: ../../library/os.rst:3081 +#: ../../library/os.rst:2337 ../../library/os.rst:2450 +#: ../../library/os.rst:3086 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2335 +#: ../../library/os.rst:2340 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2517,7 +2520,7 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2339 +#: ../../library/os.rst:2344 msgid "This function is semantically identical to :func:`unlink`." msgstr "" @@ -2527,7 +2530,7 @@ msgid "" "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2354 +#: ../../library/os.rst:2359 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2539,20 +2542,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2371 +#: ../../library/os.rst:2376 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2374 +#: ../../library/os.rst:2379 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2378 +#: ../../library/os.rst:2383 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2564,13 +2567,13 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2387 ../../library/os.rst:2427 +#: ../../library/os.rst:2392 ../../library/os.rst:2432 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2390 +#: ../../library/os.rst:2395 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." @@ -2582,11 +2585,11 @@ msgid "" "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: ../../library/os.rst:2394 +#: ../../library/os.rst:2399 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "" -#: ../../library/os.rst:2403 +#: ../../library/os.rst:2408 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2595,17 +2598,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2410 +#: ../../library/os.rst:2415 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2415 +#: ../../library/os.rst:2420 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2421 +#: ../../library/os.rst:2426 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -2614,7 +2617,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2440 +#: ../../library/os.rst:2445 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2628,11 +2631,11 @@ msgid "" "``path``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:2450 ../../library/os.rst:3154 +#: ../../library/os.rst:2455 ../../library/os.rst:3159 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2459 +#: ../../library/os.rst:2464 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2642,7 +2645,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2466 +#: ../../library/os.rst:2471 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2654,7 +2657,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2476 +#: ../../library/os.rst:2481 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2669,24 +2672,24 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:2487 +#: ../../library/os.rst:2492 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2492 +#: ../../library/os.rst:2497 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2494 +#: ../../library/os.rst:2499 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2501 +#: ../../library/os.rst:2506 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -2694,7 +2697,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2513 +#: ../../library/os.rst:2518 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2705,7 +2708,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2525 +#: ../../library/os.rst:2530 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -2713,28 +2716,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2531 +#: ../../library/os.rst:2536 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2533 +#: ../../library/os.rst:2538 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2539 +#: ../../library/os.rst:2544 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2542 +#: ../../library/os.rst:2547 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2546 +#: ../../library/os.rst:2551 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -2742,7 +2745,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2551 +#: ../../library/os.rst:2556 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -2750,29 +2753,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2556 +#: ../../library/os.rst:2561 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2559 +#: ../../library/os.rst:2564 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2563 +#: ../../library/os.rst:2568 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2566 +#: ../../library/os.rst:2571 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2572 +#: ../../library/os.rst:2577 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -2782,51 +2785,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2579 +#: ../../library/os.rst:2584 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2585 +#: ../../library/os.rst:2590 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2587 +#: ../../library/os.rst:2592 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2591 +#: ../../library/os.rst:2596 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2596 +#: ../../library/os.rst:2601 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2600 +#: ../../library/os.rst:2605 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2604 +#: ../../library/os.rst:2609 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2608 +#: ../../library/os.rst:2613 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -2836,46 +2839,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2615 ../../library/os.rst:2645 +#: ../../library/os.rst:2620 ../../library/os.rst:2650 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2620 +#: ../../library/os.rst:2625 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2624 +#: ../../library/os.rst:2629 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2628 +#: ../../library/os.rst:2633 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2633 +#: ../../library/os.rst:2638 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2637 +#: ../../library/os.rst:2642 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2640 +#: ../../library/os.rst:2645 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -2883,35 +2886,35 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2650 +#: ../../library/os.rst:2655 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2654 +#: ../../library/os.rst:2659 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2659 +#: ../../library/os.rst:2664 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2663 +#: ../../library/os.rst:2668 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2667 +#: ../../library/os.rst:2672 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -2919,13 +2922,13 @@ msgid "" "``is_file()``, ``is_symlink()`` and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2675 +#: ../../library/os.rst:2680 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2682 +#: ../../library/os.rst:2687 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -2934,21 +2937,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2688 +#: ../../library/os.rst:2693 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2691 ../../library/os.rst:3520 -#: ../../library/os.rst:3536 ../../library/os.rst:3552 -#: ../../library/os.rst:3572 +#: ../../library/os.rst:2696 ../../library/os.rst:3525 +#: ../../library/os.rst:3541 ../../library/os.rst:3557 +#: ../../library/os.rst:3577 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2694 +#: ../../library/os.rst:2699 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -2962,24 +2965,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2707 ../../library/os.rst:3440 +#: ../../library/os.rst:2712 ../../library/os.rst:3445 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2720 +#: ../../library/os.rst:2725 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2722 +#: ../../library/os.rst:2727 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2729 +#: ../../library/os.rst:2734 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -2989,100 +2992,100 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2740 +#: ../../library/os.rst:2745 msgid "" "Object whose attributes correspond roughly to the members of the :c:type:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2744 +#: ../../library/os.rst:2749 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2748 +#: ../../library/os.rst:2753 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2752 +#: ../../library/os.rst:2757 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2755 +#: ../../library/os.rst:2760 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2756 +#: ../../library/os.rst:2761 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:2762 +#: ../../library/os.rst:2767 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:2766 +#: ../../library/os.rst:2771 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:2770 +#: ../../library/os.rst:2775 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:2774 +#: ../../library/os.rst:2779 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2783 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:2782 +#: ../../library/os.rst:2787 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:2786 +#: ../../library/os.rst:2791 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:2790 +#: ../../library/os.rst:2795 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:2794 ../../library/os.rst:2810 +#: ../../library/os.rst:2799 ../../library/os.rst:2815 msgid "Platform dependent:" msgstr "" -#: ../../library/os.rst:2796 ../../library/os.rst:2812 +#: ../../library/os.rst:2801 ../../library/os.rst:2817 msgid "the time of most recent metadata change on Unix," msgstr "" -#: ../../library/os.rst:2797 +#: ../../library/os.rst:2802 msgid "the time of creation on Windows, expressed in seconds." msgstr "" -#: ../../library/os.rst:2801 +#: ../../library/os.rst:2806 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2805 +#: ../../library/os.rst:2810 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:2813 +#: ../../library/os.rst:2818 msgid "" "the time of creation on Windows, expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:2818 +#: ../../library/os.rst:2823 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, " "and :attr:`st_ctime` attributes depend on the operating system and the file " @@ -3091,7 +3094,7 @@ msgid "" "only 1-day resolution. See your operating system documentation for details." msgstr "" -#: ../../library/os.rst:2825 +#: ../../library/os.rst:2830 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:" "`st_ctime_ns` are always expressed in nanoseconds, many systems do not " @@ -3102,78 +3105,78 @@ msgid "" "attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`." msgstr "" -#: ../../library/os.rst:2834 +#: ../../library/os.rst:2839 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:2839 +#: ../../library/os.rst:2844 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:2844 +#: ../../library/os.rst:2849 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:2849 +#: ../../library/os.rst:2854 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:2853 +#: ../../library/os.rst:2858 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:2855 +#: ../../library/os.rst:2860 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:2860 +#: ../../library/os.rst:2865 msgid "File generation number." msgstr "" -#: ../../library/os.rst:2864 +#: ../../library/os.rst:2869 msgid "Time of file creation." msgstr "" -#: ../../library/os.rst:2866 +#: ../../library/os.rst:2871 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2871 +#: ../../library/os.rst:2876 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:2874 +#: ../../library/os.rst:2879 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:2878 +#: ../../library/os.rst:2883 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:2882 +#: ../../library/os.rst:2887 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:2886 +#: ../../library/os.rst:2891 msgid "File type." msgstr "" -#: ../../library/os.rst:2888 +#: ../../library/os.rst:2893 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:2892 +#: ../../library/os.rst:2897 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:" @@ -3181,21 +3184,21 @@ msgid "" "mod:`stat` module." msgstr "" -#: ../../library/os.rst:2899 +#: ../../library/os.rst:2904 msgid "" "When :attr:`st_file_attributes` has the ``FILE_ATTRIBUTE_REPARSE_POINT`` " "set, this field contains the tag identifying the type of reparse point. See " "the ``IO_REPARSE_TAG_*`` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:2903 +#: ../../library/os.rst:2908 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:type:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:2907 +#: ../../library/os.rst:2912 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3207,35 +3210,35 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:2916 +#: ../../library/os.rst:2921 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:2920 +#: ../../library/os.rst:2925 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "" -#: ../../library/os.rst:2923 +#: ../../library/os.rst:2928 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:2927 +#: ../../library/os.rst:2932 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:2930 +#: ../../library/os.rst:2935 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "" -#: ../../library/os.rst:2933 +#: ../../library/os.rst:2938 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:2940 +#: ../../library/os.rst:2945 msgid "" "Perform a :c:func:`statvfs` system call on the given path. The return value " "is an object whose attributes describe the filesystem on the given path, and " @@ -3245,7 +3248,7 @@ msgid "" "`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:2947 +#: ../../library/os.rst:2952 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3253,7 +3256,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:2952 +#: ../../library/os.rst:2957 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3266,11 +3269,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:2965 +#: ../../library/os.rst:2970 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:2971 +#: ../../library/os.rst:2976 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3278,11 +3281,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:2980 +#: ../../library/os.rst:2985 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:2986 +#: ../../library/os.rst:2991 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3294,7 +3297,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:2996 +#: ../../library/os.rst:3001 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3302,13 +3305,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3003 +#: ../../library/os.rst:3008 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3011 +#: ../../library/os.rst:3016 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3317,19 +3320,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3022 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3022 +#: ../../library/os.rst:3027 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3030 +#: ../../library/os.rst:3035 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3338,7 +3341,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3037 +#: ../../library/os.rst:3042 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3347,7 +3350,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3050 +#: ../../library/os.rst:3055 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3360,7 +3363,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3060 +#: ../../library/os.rst:3065 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3369,11 +3372,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3073 +#: ../../library/os.rst:3078 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3075 +#: ../../library/os.rst:3080 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3383,7 +3386,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3086 +#: ../../library/os.rst:3091 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3391,7 +3394,7 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3092 +#: ../../library/os.rst:3097 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" @@ -3402,21 +3405,21 @@ msgid "" "``src``, ``dst``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3105 +#: ../../library/os.rst:3110 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3112 +#: ../../library/os.rst:3117 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3118 +#: ../../library/os.rst:3123 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3127 +#: ../../library/os.rst:3132 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." @@ -3428,46 +3431,46 @@ msgid "" "``path``, ``length``." msgstr "" -#: ../../library/os.rst:3147 +#: ../../library/os.rst:3152 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3163 +#: ../../library/os.rst:3168 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3170 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3168 +#: ../../library/os.rst:3173 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3171 +#: ../../library/os.rst:3176 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3174 +#: ../../library/os.rst:3179 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3178 +#: ../../library/os.rst:3183 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3180 +#: ../../library/os.rst:3185 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3483,13 +3486,13 @@ msgid "" "``path``, ``times``, ``ns``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3193 +#: ../../library/os.rst:3198 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3207 +#: ../../library/os.rst:3212 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3497,7 +3500,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3212 +#: ../../library/os.rst:3217 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3511,7 +3514,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3223 +#: ../../library/os.rst:3228 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3522,7 +3525,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3231 +#: ../../library/os.rst:3236 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3535,7 +3538,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3240 +#: ../../library/os.rst:3245 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3545,35 +3548,35 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3246 +#: ../../library/os.rst:3251 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3252 +#: ../../library/os.rst:3257 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3258 +#: ../../library/os.rst:3263 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3262 ../../library/os.rst:3323 +#: ../../library/os.rst:3267 ../../library/os.rst:3328 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3275 +#: ../../library/os.rst:3280 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " @@ -3586,25 +3589,25 @@ msgid "" "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -#: ../../library/os.rst:3292 +#: ../../library/os.rst:3297 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3306 +#: ../../library/os.rst:3311 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3309 +#: ../../library/os.rst:3314 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3312 +#: ../../library/os.rst:3317 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3612,14 +3615,14 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3319 +#: ../../library/os.rst:3324 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3336 +#: ../../library/os.rst:3341 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" @@ -3631,11 +3634,11 @@ msgid "" "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3360 +#: ../../library/os.rst:3365 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3366 +#: ../../library/os.rst:3371 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -3643,7 +3646,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3371 +#: ../../library/os.rst:3376 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -3653,24 +3656,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3378 +#: ../../library/os.rst:3383 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3401 +#: ../../library/os.rst:3406 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3403 -#, fuzzy +#: ../../library/os.rst:3408 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3405 +#: ../../library/os.rst:3410 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3412 +#: ../../library/os.rst:3417 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -3679,7 +3681,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3418 +#: ../../library/os.rst:3423 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -3687,87 +3689,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3423 +#: ../../library/os.rst:3428 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3426 +#: ../../library/os.rst:3431 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3429 +#: ../../library/os.rst:3434 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3433 +#: ../../library/os.rst:3438 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3436 +#: ../../library/os.rst:3441 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3457 +#: ../../library/os.rst:3462 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3463 +#: ../../library/os.rst:3468 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3466 ../../library/os.rst:3475 -#: ../../library/os.rst:3483 ../../library/os.rst:3492 +#: ../../library/os.rst:3471 ../../library/os.rst:3480 +#: ../../library/os.rst:3488 ../../library/os.rst:3497 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3472 +#: ../../library/os.rst:3477 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3481 +#: ../../library/os.rst:3486 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3489 +#: ../../library/os.rst:3494 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3498 +#: ../../library/os.rst:3503 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3501 +#: ../../library/os.rst:3506 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3507 +#: ../../library/os.rst:3512 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3511 +#: ../../library/os.rst:3516 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3515 +#: ../../library/os.rst:3520 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -3781,12 +3783,12 @@ msgid "" "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3525 ../../library/os.rst:3557 -#: ../../library/os.rst:3582 +#: ../../library/os.rst:3530 ../../library/os.rst:3562 +#: ../../library/os.rst:3587 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3531 +#: ../../library/os.rst:3536 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -3800,7 +3802,7 @@ msgid "" "``path``." msgstr "" -#: ../../library/os.rst:3547 +#: ../../library/os.rst:3552 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -3814,7 +3816,7 @@ msgid "" "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3563 +#: ../../library/os.rst:3568 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -3826,7 +3828,7 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3577 +#: ../../library/os.rst:3582 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." @@ -3838,33 +3840,33 @@ msgid "" "``path``, ``attribute``, ``value``, ``flags``." msgstr "" -#: ../../library/os.rst:3588 +#: ../../library/os.rst:3593 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3594 +#: ../../library/os.rst:3599 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3600 +#: ../../library/os.rst:3605 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3607 +#: ../../library/os.rst:3612 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3609 +#: ../../library/os.rst:3614 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3611 +#: ../../library/os.rst:3616 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -3875,7 +3877,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3622 +#: ../../library/os.rst:3627 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -3884,24 +3886,24 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3631 +#: ../../library/os.rst:3636 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3633 +#: ../../library/os.rst:3638 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3637 +#: ../../library/os.rst:3642 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3640 +#: ../../library/os.rst:3645 msgid "" "See the `Microsoft documentation `_ for more information about how " @@ -3914,7 +3916,7 @@ msgid "" "argument ``path``." msgstr "" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3653 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -3922,14 +3924,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3655 +#: ../../library/os.rst:3660 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3670 +#: ../../library/os.rst:3675 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -3937,7 +3939,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3675 +#: ../../library/os.rst:3680 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -3945,7 +3947,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3681 +#: ../../library/os.rst:3686 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -3958,7 +3960,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3690 +#: ../../library/os.rst:3695 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -3971,7 +3973,7 @@ msgid "" "absolute or relative path." msgstr "" -#: ../../library/os.rst:3700 +#: ../../library/os.rst:3705 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -3981,7 +3983,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3707 +#: ../../library/os.rst:3712 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -3996,25 +3998,25 @@ msgid "" "``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:3716 +#: ../../library/os.rst:3721 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3725 +#: ../../library/os.rst:3730 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3730 +#: ../../library/os.rst:3735 msgid "" "The standard way to exit is ``sys.exit(n)``. :func:`_exit` should normally " "only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3733 +#: ../../library/os.rst:3738 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4022,104 +4024,104 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3739 +#: ../../library/os.rst:3744 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:3746 +#: ../../library/os.rst:3751 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:3754 +#: ../../library/os.rst:3759 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3762 +#: ../../library/os.rst:3767 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:3769 +#: ../../library/os.rst:3774 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:3776 +#: ../../library/os.rst:3781 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:3783 +#: ../../library/os.rst:3788 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:3790 +#: ../../library/os.rst:3795 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:3797 +#: ../../library/os.rst:3802 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:3804 +#: ../../library/os.rst:3809 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:3812 +#: ../../library/os.rst:3817 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:3820 +#: ../../library/os.rst:3825 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:3827 +#: ../../library/os.rst:3832 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:3834 +#: ../../library/os.rst:3839 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:3843 +#: ../../library/os.rst:3848 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:3851 +#: ../../library/os.rst:3856 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:3859 +#: ../../library/os.rst:3864 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:3866 +#: ../../library/os.rst:3871 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:3873 +#: ../../library/os.rst:3878 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3876 +#: ../../library/os.rst:3881 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." @@ -4130,17 +4132,17 @@ msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -#: ../../library/os.rst:3881 +#: ../../library/os.rst:3886 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3887 +#: ../../library/os.rst:3892 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:3894 +#: ../../library/os.rst:3899 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4154,19 +4156,19 @@ msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -#: ../../library/os.rst:3902 +#: ../../library/os.rst:3907 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3915 +#: ../../library/os.rst:3920 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:3918 +#: ../../library/os.rst:3923 msgid "" "Windows: The :data:`signal.CTRL_C_EVENT` and :data:`signal.CTRL_BREAK_EVENT` " "signals are special signals which can only be sent to console processes " @@ -4176,7 +4178,7 @@ msgid "" "version of :func:`kill` additionally takes process handles to be killed." msgstr "" -#: ../../library/os.rst:3926 +#: ../../library/os.rst:3931 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" @@ -4186,11 +4188,11 @@ msgid "" "``pid``, ``sig``." msgstr "" -#: ../../library/os.rst:3932 +#: ../../library/os.rst:3937 msgid "Windows support." msgstr "" -#: ../../library/os.rst:3942 +#: ../../library/os.rst:3947 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" @@ -4200,12 +4202,12 @@ msgid "" "``pgid``, ``sig``." msgstr "" -#: ../../library/os.rst:3951 +#: ../../library/os.rst:3956 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:3958 +#: ../../library/os.rst:3963 msgid "" "Return a file descriptor referring to the process *pid*. This descriptor " "can be used to perform process management without races and signals. The " @@ -4213,21 +4215,21 @@ msgid "" "currently defined." msgstr "" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:3968 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:3965 +#: ../../library/os.rst:3970 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:3971 +#: ../../library/os.rst:3976 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:3979 +#: ../../library/os.rst:3984 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4237,7 +4239,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:3987 +#: ../../library/os.rst:3992 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4249,60 +4251,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:3997 +#: ../../library/os.rst:4002 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4002 +#: ../../library/os.rst:4007 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4006 +#: ../../library/os.rst:4011 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4009 +#: ../../library/os.rst:4014 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4012 +#: ../../library/os.rst:4017 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4021 +#: ../../library/os.rst:4026 msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4023 +#: ../../library/os.rst:4028 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4025 +#: ../../library/os.rst:4030 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4028 +#: ../../library/os.rst:4033 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4037 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4311,31 +4313,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4045 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4042 +#: ../../library/os.rst:4047 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4046 +#: ../../library/os.rst:4051 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4048 +#: ../../library/os.rst:4053 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4052 +#: ../../library/os.rst:4057 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4054 +#: ../../library/os.rst:4059 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4056 +#: ../../library/os.rst:4061 msgid "" "These tuples correspond to the C library :c:func:" "`posix_spawn_file_actions_addopen`, :c:func:" @@ -4344,7 +4346,7 @@ msgid "" "`posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4062 +#: ../../library/os.rst:4067 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4353,7 +4355,7 @@ msgid "" "corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4068 +#: ../../library/os.rst:4073 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4364,7 +4366,7 @@ msgid "" "library :c:data:`POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4076 +#: ../../library/os.rst:4081 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:data:`POSIX_SPAWN_SETSID` or :c:data:" @@ -4372,7 +4374,7 @@ msgid "" "raised." msgstr "" -#: ../../library/os.rst:4081 +#: ../../library/os.rst:4086 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4380,14 +4382,14 @@ msgid "" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4086 +#: ../../library/os.rst:4091 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:data:" "`POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4090 +#: ../../library/os.rst:4095 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4403,77 +4405,76 @@ msgid "" "``path``, ``argv``, ``env``." msgstr "" -#: ../../library/os.rst:4107 +#: ../../library/os.rst:4112 msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4109 +#: ../../library/os.rst:4114 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4117 -#, fuzzy +#: ../../library/os.rst:4122 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4119 +#: ../../library/os.rst:4124 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4125 +#: ../../library/os.rst:4130 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4130 +#: ../../library/os.rst:4135 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4131 +#: ../../library/os.rst:4136 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4133 +#: ../../library/os.rst:4138 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4135 +#: ../../library/os.rst:4140 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4139 +#: ../../library/os.rst:4144 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4144 +#: ../../library/os.rst:4149 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4148 +#: ../../library/os.rst:4153 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4164 +#: ../../library/os.rst:4169 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4166 +#: ../../library/os.rst:4171 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4481,7 +4482,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4171 +#: ../../library/os.rst:4176 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4490,13 +4491,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4177 +#: ../../library/os.rst:4182 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4180 +#: ../../library/os.rst:4185 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4508,7 +4509,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4189 +#: ../../library/os.rst:4194 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4521,7 +4522,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4199 +#: ../../library/os.rst:4204 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4533,7 +4534,7 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4208 +#: ../../library/os.rst:4213 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" @@ -4545,7 +4546,7 @@ msgid "" "``mode``, ``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4226 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4553,7 +4554,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4233 +#: ../../library/os.rst:4238 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4561,7 +4562,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4248 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4570,7 +4571,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4255 +#: ../../library/os.rst:4260 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4580,11 +4581,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4266 +#: ../../library/os.rst:4271 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4268 +#: ../../library/os.rst:4273 msgid "" "When *operation* is not specified or ``'open'``, this acts like double-" "clicking the file in Windows Explorer, or giving the file name as an " @@ -4593,7 +4594,7 @@ msgid "" "associated." msgstr "" -#: ../../library/os.rst:4273 +#: ../../library/os.rst:4278 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -4601,28 +4602,28 @@ msgid "" "``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4278 +#: ../../library/os.rst:4283 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4282 +#: ../../library/os.rst:4287 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4286 +#: ../../library/os.rst:4291 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`ShellExecute` function." msgstr "" -#: ../../library/os.rst:4290 +#: ../../library/os.rst:4295 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -4633,7 +4634,7 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4298 +#: ../../library/os.rst:4303 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute` " "function is not resolved until this function is first called. If the " @@ -4652,13 +4653,13 @@ msgid "" "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." msgstr "" -#: ../../library/os.rst:4308 +#: ../../library/os.rst:4313 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4315 +#: ../../library/os.rst:4320 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -4669,13 +4670,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4323 +#: ../../library/os.rst:4328 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4326 +#: ../../library/os.rst:4331 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -4684,7 +4685,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4332 +#: ../../library/os.rst:4337 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -4692,7 +4693,7 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4337 +#: ../../library/os.rst:4342 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " @@ -4705,40 +4706,40 @@ msgid "" "``command``." msgstr "" -#: ../../library/os.rst:4348 +#: ../../library/os.rst:4353 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4351 +#: ../../library/os.rst:4356 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4352 +#: ../../library/os.rst:4357 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4353 +#: ../../library/os.rst:4358 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4354 +#: ../../library/os.rst:4359 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4355 +#: ../../library/os.rst:4360 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4357 +#: ../../library/os.rst:4362 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4361 +#: ../../library/os.rst:4366 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -4748,7 +4749,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4375 +#: ../../library/os.rst:4380 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -4757,83 +4758,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4381 +#: ../../library/os.rst:4386 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4384 ../../library/os.rst:4456 +#: ../../library/os.rst:4389 ../../library/os.rst:4461 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4391 +#: ../../library/os.rst:4396 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4398 +#: ../../library/os.rst:4403 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4400 +#: ../../library/os.rst:4405 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4403 +#: ../../library/os.rst:4408 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4407 +#: ../../library/os.rst:4412 msgid "" "The return value is an object representing the data contained in the :c:type:" "`!siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4410 +#: ../../library/os.rst:4415 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4411 +#: ../../library/os.rst:4416 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4412 +#: ../../library/os.rst:4417 msgid ":attr:`!si_signo` (always :data:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4413 +#: ../../library/os.rst:4418 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4414 +#: ../../library/os.rst:4419 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4416 +#: ../../library/os.rst:4421 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4428 +#: ../../library/os.rst:4433 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4430 +#: ../../library/os.rst:4435 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -4842,7 +4843,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4435 +#: ../../library/os.rst:4440 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -4852,7 +4853,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4442 +#: ../../library/os.rst:4447 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -4861,7 +4862,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4448 +#: ../../library/os.rst:4453 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -4873,7 +4874,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4469 +#: ../../library/os.rst:4474 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -4882,13 +4883,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4476 ../../library/os.rst:4490 +#: ../../library/os.rst:4481 ../../library/os.rst:4495 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4484 +#: ../../library/os.rst:4489 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -4897,118 +4898,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4501 +#: ../../library/os.rst:4506 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4504 +#: ../../library/os.rst:4509 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4505 +#: ../../library/os.rst:4510 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4506 +#: ../../library/os.rst:4511 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4507 +#: ../../library/os.rst:4512 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4512 +#: ../../library/os.rst:4517 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4515 +#: ../../library/os.rst:4520 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4526 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4535 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4533 +#: ../../library/os.rst:4538 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4548 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4546 ../../library/os.rst:4578 +#: ../../library/os.rst:4551 ../../library/os.rst:4583 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4555 +#: ../../library/os.rst:4560 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4559 +#: ../../library/os.rst:4564 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4566 +#: ../../library/os.rst:4571 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4575 +#: ../../library/os.rst:4580 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4590 +#: ../../library/os.rst:4595 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4597 +#: ../../library/os.rst:4602 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4603 +#: ../../library/os.rst:4608 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4605 +#: ../../library/os.rst:4610 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4607 +#: ../../library/os.rst:4612 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4610 +#: ../../library/os.rst:4615 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5016,15 +5017,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4614 +#: ../../library/os.rst:4619 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4616 +#: ../../library/os.rst:4621 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4618 +#: ../../library/os.rst:4623 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5032,217 +5033,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4625 +#: ../../library/os.rst:4630 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4633 +#: ../../library/os.rst:4638 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4644 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4642 ../../library/os.rst:4708 +#: ../../library/os.rst:4647 ../../library/os.rst:4713 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4649 +#: ../../library/os.rst:4654 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :data:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4653 +#: ../../library/os.rst:4658 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4660 +#: ../../library/os.rst:4665 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4668 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4671 +#: ../../library/os.rst:4676 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4679 +#: ../../library/os.rst:4684 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4688 +#: ../../library/os.rst:4693 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4695 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4697 +#: ../../library/os.rst:4702 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4704 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4706 +#: ../../library/os.rst:4711 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4714 +#: ../../library/os.rst:4719 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4716 +#: ../../library/os.rst:4721 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4727 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4727 +#: ../../library/os.rst:4732 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4731 +#: ../../library/os.rst:4736 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4736 +#: ../../library/os.rst:4741 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4740 +#: ../../library/os.rst:4745 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4744 +#: ../../library/os.rst:4749 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4748 +#: ../../library/os.rst:4753 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4752 +#: ../../library/os.rst:4757 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:4759 +#: ../../library/os.rst:4764 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:4763 +#: ../../library/os.rst:4768 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4767 +#: ../../library/os.rst:4772 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4772 +#: ../../library/os.rst:4777 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4778 +#: ../../library/os.rst:4783 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4784 +#: ../../library/os.rst:4789 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4791 +#: ../../library/os.rst:4796 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:4798 +#: ../../library/os.rst:4803 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4804 +#: ../../library/os.rst:4809 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4810 +#: ../../library/os.rst:4815 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4816 +#: ../../library/os.rst:4821 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4821 +#: ../../library/os.rst:4826 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:4828 +#: ../../library/os.rst:4833 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4835 +#: ../../library/os.rst:4840 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4840 +#: ../../library/os.rst:4845 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5253,13 +5254,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4848 +#: ../../library/os.rst:4853 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4851 +#: ../../library/os.rst:4856 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5267,33 +5268,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4861 +#: ../../library/os.rst:4866 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4870 +#: ../../library/os.rst:4875 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4872 +#: ../../library/os.rst:4877 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:4882 +#: ../../library/os.rst:4887 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:4891 +#: ../../library/os.rst:4896 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5302,44 +5303,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4906 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4907 +#: ../../library/os.rst:4912 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:4910 +#: ../../library/os.rst:4915 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4913 +#: ../../library/os.rst:4918 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4919 +#: ../../library/os.rst:4924 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4927 +#: ../../library/os.rst:4932 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4936 +#: ../../library/os.rst:4941 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5348,7 +5349,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4946 +#: ../../library/os.rst:4951 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5356,27 +5357,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4955 +#: ../../library/os.rst:4960 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4963 +#: ../../library/os.rst:4968 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4970 +#: ../../library/os.rst:4975 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4977 +#: ../../library/os.rst:4982 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5385,36 +5386,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4991 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4997 +#: ../../library/os.rst:5002 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5005 +#: ../../library/os.rst:5010 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5010 +#: ../../library/os.rst:5015 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5013 +#: ../../library/os.rst:5018 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5016 +#: ../../library/os.rst:5021 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5422,36 +5423,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5021 +#: ../../library/os.rst:5026 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:data:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5025 +#: ../../library/os.rst:5030 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5028 +#: ../../library/os.rst:5033 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5034 +#: ../../library/os.rst:5039 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5036 +#: ../../library/os.rst:5041 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5040 +#: ../../library/os.rst:5045 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5461,63 +5462,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5047 +#: ../../library/os.rst:5052 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5051 +#: ../../library/os.rst:5056 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5054 +#: ../../library/os.rst:5059 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5058 +#: ../../library/os.rst:5063 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5062 +#: ../../library/os.rst:5067 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5071 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5072 +#: ../../library/os.rst:5077 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5078 +#: ../../library/os.rst:5083 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5082 +#: ../../library/os.rst:5087 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5089 +#: ../../library/os.rst:5094 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." diff --git a/library/queue.po b/library/queue.po index c278b4c8b2..d0cfe00f62 100644 --- a/library/queue.po +++ b/library/queue.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-03 00:22+0000\n" +"POT-Creation-Date: 2023-02-23 00:17+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,10 +45,10 @@ msgstr "" msgid "" "The module implements three types of queue, which differ only in the order " "in which the entries are retrieved. In a :abbr:`FIFO (first-in, first-out)` " -"queue, the first tasks added are the first retrieved. In a :abbr:`LIFO (last-" -"in, first-out)` queue, the most recently added entry is the first retrieved " -"(operating like a stack). With a priority queue, the entries are kept " -"sorted (using the :mod:`heapq` module) and the lowest valued entry is " +"queue, the first tasks added are the first retrieved. In a :abbr:`LIFO " +"(last-in, first-out)` queue, the most recently added entry is the first " +"retrieved (operating like a stack). With a priority queue, the entries are " +"kept sorted (using the :mod:`heapq` module) and the lowest valued entry is " "retrieved first." msgstr "" "此 module 實作三種型別的佇列,它們僅在取出條目的順序上有所不同。在 :abbr:" @@ -118,11 +118,11 @@ msgstr "" #: ../../library/queue.rst:59 msgid "" "The lowest valued entries are retrieved first (the lowest valued entry is " -"the one returned by ``sorted(list(entries))[0]``). A typical pattern for " +"the one that would be returned by ``min(entries)``). A typical pattern for " "entries is a tuple in the form: ``(priority_number, data)``." msgstr "" -"最低值的條目會最先被取出(最低值的條目是被 ``sorted(list(entries))[0]`` 回傳" -"的)。條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple(元組)。" +"最低值的條目會最先被取出(最低值的條目是被會 ``min(entries)`` 回傳的那一個)" +"。條目的典型模式是格式為 ``(priority_number, data)`` 的 tuple(元組)。" #: ../../library/queue.rst:63 msgid "" @@ -203,27 +203,27 @@ msgstr "" #: ../../library/queue.rst:130 msgid "" -"Put *item* into the queue. If optional args *block* is true and *timeout* is " -"``None`` (the default), block if necessary until a free slot is available. " -"If *timeout* is a positive number, it blocks at most *timeout* seconds and " -"raises the :exc:`Full` exception if no free slot was available within that " -"time. Otherwise (*block* is false), put an item on the queue if a free slot " -"is immediately available, else raise the :exc:`Full` exception (*timeout* is " -"ignored in that case)." +"Put *item* into the queue. If optional args *block* is true and *timeout* " +"is ``None`` (the default), block if necessary until a free slot is " +"available. If *timeout* is a positive number, it blocks at most *timeout* " +"seconds and raises the :exc:`Full` exception if no free slot was available " +"within that time. Otherwise (*block* is false), put an item on the queue if " +"a free slot is immediately available, else raise the :exc:`Full` exception " +"(*timeout* is ignored in that case)." msgstr "" -"將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 ``None``" -"\\ (預設值),則在必要時阻塞,直到自由槽 (free slot) 可用。如果 *timeout* 為" -"正數,則最多阻塞 *timeout* 秒,如果該時間內沒有可用的自由槽,則會引發 :exc:" -"`Full` 例外。否則(*block* 為 false),如果自由槽立即可用,則將項目放在佇列" -"中,否則引發 :exc:`Full` 例外(在這種情況下,*timeout* 將被忽略)。" +"將 *item* 放入佇列中。如果可選的 args *block* 為 true、*timeout* 為 " +"``None``\\ (預設值),則在必要時阻塞,直到自由槽 (free slot) 可用。如果 " +"*timeout* 為正數,則最多阻塞 *timeout* 秒,如果該時間內沒有可用的自由槽,則會" +"引發 :exc:`Full` 例外。否則(*block* 為 false),如果自由槽立即可用,則將項目" +"放在佇列中,否則引發 :exc:`Full` 例外(在這種情況下,*timeout* 將被忽略)。" #: ../../library/queue.rst:141 msgid "Equivalent to ``put(item, block=False)``." msgstr "等效於 ``put(item, block=False)``。" -#: ../../library/queue.rst:146 +#: ../../library/queue.rst:146 ../../library/queue.rst:258 msgid "" -"Remove and return an item from the queue. If optional args *block* is true " +"Remove and return an item from the queue. If optional args *block* is true " "and *timeout* is ``None`` (the default), block if necessary until an item is " "available. If *timeout* is a positive number, it blocks at most *timeout* " "seconds and raises the :exc:`Empty` exception if no item was available " @@ -241,7 +241,7 @@ msgstr "" msgid "" "Prior to 3.0 on POSIX systems, and for all versions on Windows, if *block* " "is true and *timeout* is ``None``, this operation goes into an " -"uninterruptible wait on an underlying lock. This means that no exceptions " +"uninterruptible wait on an underlying lock. This means that no exceptions " "can occur, and in particular a SIGINT will not trigger a :exc:" "`KeyboardInterrupt`." msgstr "" @@ -294,7 +294,7 @@ msgid "" "The count of unfinished tasks goes up whenever an item is added to the " "queue. The count goes down whenever a consumer thread calls :meth:" "`task_done` to indicate that the item was retrieved and all work on it is " -"complete. When the count of unfinished tasks drops to zero, :meth:`join` " +"complete. When the count of unfinished tasks drops to zero, :meth:`join` " "unblocks." msgstr "" "每當項目被加到佇列中時,未完成任務的計數都會增加。每當消費者執行緒呼叫 :meth:" @@ -326,7 +326,7 @@ msgstr "" #: ../../library/queue.rst:230 msgid "" -"Return ``True`` if the queue is empty, ``False`` otherwise. If empty() " +"Return ``True`` if the queue is empty, ``False`` otherwise. If empty() " "returns ``False`` it doesn't guarantee that a subsequent call to get() will " "not block." msgstr "" @@ -364,22 +364,6 @@ msgid "" msgstr "" "等效於 ``put(item, block=False)``,用於與 :meth:`Queue.put_nowait` 相容。" -#: ../../library/queue.rst:258 -msgid "" -"Remove and return an item from the queue. If optional args *block* is true " -"and *timeout* is ``None`` (the default), block if necessary until an item is " -"available. If *timeout* is a positive number, it blocks at most *timeout* " -"seconds and raises the :exc:`Empty` exception if no item was available " -"within that time. Otherwise (*block* is false), return an item if one is " -"immediately available, else raise the :exc:`Empty` exception (*timeout* is " -"ignored in that case)." -msgstr "" -"從佇列中移除並回傳一個項目。如果可選的 args *block* 為 true,且 *timeout* 為 " -"``None``\\ (預設值),則在必要時阻塞,直到有可用的項目。如果 *timeout* 是正" -"數,則最多會阻塞 *timeout* 秒,如果該時間內沒有可用的項目,則會引發 :exc:" -"`Empty` 例外。否則(*block* 為 false),如果立即可用,則回傳一個項目,否則引" -"發 :exc:`Empty` 例外(在這種情況下,*timeout* 將被忽略)。" - #: ../../library/queue.rst:275 msgid "Class :class:`multiprocessing.Queue`" msgstr "Class :class:`multiprocessing.Queue`" diff --git a/library/re.po b/library/re.po index c662d1f822..ec7692e3e6 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-21 00:15+0000\n" +"POT-Creation-Date: 2023-02-27 00:17+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-" @@ -146,7 +146,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1525 +#: ../../library/re.rst:104 ../../library/re.rst:1526 msgid "``.``" msgstr "``.``" @@ -330,7 +330,7 @@ msgid "" "recommended that you use raw strings for all but the simplest expressions." msgstr "" -#: ../../library/re.rst:293 +#: ../../library/re.rst:294 msgid "``[]``" msgstr "``[]``" @@ -382,10 +382,11 @@ msgstr "" msgid "" "To match a literal ``']'`` inside a set, precede it with a backslash, or " "place it at the beginning of the set. For example, both ``[()[\\]{}]`` and " -"``[]()[{}]`` will both match a parenthesis." +"``[]()[{}]`` will match a right bracket, as well as left bracket, braces, " +"and parentheses." msgstr "" -#: ../../library/re.rst:281 +#: ../../library/re.rst:282 msgid "" "Support of nested sets and set operations as in `Unicode Technical Standard " "#18`_ might be added in the future. This would change the syntax, so to " @@ -395,17 +396,17 @@ msgid "" "``'||'``. To avoid a warning escape them with a backslash." msgstr "" -#: ../../library/re.rst:291 +#: ../../library/re.rst:292 msgid "" ":exc:`FutureWarning` is raised if a character set contains constructs that " "will change semantically in the future." msgstr "" -#: ../../library/re.rst:306 +#: ../../library/re.rst:307 msgid "``|``" msgstr "``|``" -#: ../../library/re.rst:298 +#: ../../library/re.rst:299 msgid "" "``A|B``, where *A* and *B* can be arbitrary REs, creates a regular " "expression that will match either *A* or *B*. An arbitrary number of REs " @@ -418,11 +419,11 @@ msgid "" "use ``\\|``, or enclose it inside a character class, as in ``[|]``." msgstr "" -#: ../../library/re.rst:316 +#: ../../library/re.rst:317 msgid "``(...)``" msgstr "``(...)``" -#: ../../library/re.rst:312 +#: ../../library/re.rst:313 msgid "" "Matches whatever regular expression is inside the parentheses, and indicates " "the start and end of a group; the contents of a group can be retrieved after " @@ -432,11 +433,11 @@ msgid "" "character class: ``[(]``, ``[)]``." msgstr "" -#: ../../library/re.rst:325 +#: ../../library/re.rst:326 msgid "``(?...)``" msgstr "``(?...)``" -#: ../../library/re.rst:321 +#: ../../library/re.rst:322 msgid "" "This is an extension notation (a ``'?'`` following a ``'('`` is not " "meaningful otherwise). The first character after the ``'?'`` determines " @@ -445,11 +446,11 @@ msgid "" "rule. Following are the currently supported extensions." msgstr "" -#: ../../library/re.rst:342 +#: ../../library/re.rst:343 msgid "``(?aiLmsux)``" msgstr "``(?aiLmsux)``" -#: ../../library/re.rst:328 +#: ../../library/re.rst:329 msgid "" "(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " "``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters " @@ -463,15 +464,15 @@ msgid "" "first in the expression string." msgstr "" -#: ../../library/re.rst:341 +#: ../../library/re.rst:342 msgid "This construction can only be used at the start of the expression." msgstr "" -#: ../../library/re.rst:350 +#: ../../library/re.rst:351 msgid "``(?:...)``" msgstr "``(?:...)``" -#: ../../library/re.rst:347 +#: ../../library/re.rst:348 msgid "" "A non-capturing version of regular parentheses. Matches whatever regular " "expression is inside the parentheses, but the substring matched by the group " @@ -479,11 +480,11 @@ msgid "" "pattern." msgstr "" -#: ../../library/re.rst:376 +#: ../../library/re.rst:377 msgid "``(?aiLmsux-imsx:...)``" msgstr "``(?aiLmsux-imsx:...)``" -#: ../../library/re.rst:353 +#: ../../library/re.rst:354 msgid "" "(Zero or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " "``'s'``, ``'u'``, ``'x'``, optionally followed by ``'-'`` followed by one or " @@ -495,7 +496,7 @@ msgid "" "flags are described in :ref:`contents-of-module-re`.)" msgstr "" -#: ../../library/re.rst:363 +#: ../../library/re.rst:364 msgid "" "The letters ``'a'``, ``'L'`` and ``'u'`` are mutually exclusive when used as " "inline flags, so they can't be combined or follow ``'-'``. Instead, when " @@ -508,15 +509,15 @@ msgid "" "restored outside of the group." msgstr "" -#: ../../library/re.rst:375 +#: ../../library/re.rst:376 msgid "The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group." msgstr "" -#: ../../library/re.rst:391 +#: ../../library/re.rst:392 msgid "``(?>...)``" msgstr "``(?>...)``" -#: ../../library/re.rst:379 +#: ../../library/re.rst:380 msgid "" "Attempts to match ``...`` as if it was a separate regular expression, and if " "successful, continues to match the rest of the pattern following it. If the " @@ -530,11 +531,11 @@ msgid "" "thus fail to match." msgstr "" -#: ../../library/re.rst:421 +#: ../../library/re.rst:422 msgid "``(?P...)``" msgstr "``(?P...)``" -#: ../../library/re.rst:396 +#: ../../library/re.rst:397 msgid "" "Similar to regular parentheses, but the substring matched by the group is " "accessible via the symbolic group name *name*. Group names must be valid " @@ -543,106 +544,106 @@ msgid "" "the group were not named." msgstr "" -#: ../../library/re.rst:402 +#: ../../library/re.rst:403 msgid "" "Named groups can be referenced in three contexts. If the pattern is ``(?" "P['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either " "single or double quotes):" msgstr "" -#: ../../library/re.rst:407 +#: ../../library/re.rst:408 msgid "Context of reference to group \"quote\"" msgstr "" -#: ../../library/re.rst:407 +#: ../../library/re.rst:408 msgid "Ways to reference it" msgstr "" -#: ../../library/re.rst:409 +#: ../../library/re.rst:410 msgid "in the same pattern itself" msgstr "" -#: ../../library/re.rst:409 +#: ../../library/re.rst:410 msgid "``(?P=quote)`` (as shown)" msgstr "" -#: ../../library/re.rst:410 ../../library/re.rst:417 +#: ../../library/re.rst:411 ../../library/re.rst:418 msgid "``\\1``" msgstr "``\\1``" -#: ../../library/re.rst:412 +#: ../../library/re.rst:413 msgid "when processing match object *m*" msgstr "" -#: ../../library/re.rst:412 +#: ../../library/re.rst:413 msgid "``m.group('quote')``" msgstr "``m.group('quote')``" -#: ../../library/re.rst:413 +#: ../../library/re.rst:414 msgid "``m.end('quote')`` (etc.)" msgstr "" -#: ../../library/re.rst:415 +#: ../../library/re.rst:416 msgid "in a string passed to the *repl* argument of ``re.sub()``" msgstr "" -#: ../../library/re.rst:415 +#: ../../library/re.rst:416 msgid "``\\g``" msgstr "``\\g``" -#: ../../library/re.rst:416 +#: ../../library/re.rst:417 msgid "``\\g<1>``" msgstr "``\\g<1>``" -#: ../../library/re.rst:420 +#: ../../library/re.rst:421 msgid "Group names containing non-ASCII characters in bytes patterns." msgstr "" -#: ../../library/re.rst:427 +#: ../../library/re.rst:428 msgid "``(?P=name)``" msgstr "``(?P=name)``" -#: ../../library/re.rst:426 +#: ../../library/re.rst:427 msgid "" "A backreference to a named group; it matches whatever text was matched by " "the earlier group named *name*." msgstr "" -#: ../../library/re.rst:432 +#: ../../library/re.rst:433 msgid "``(?#...)``" msgstr "``(?#...)``" -#: ../../library/re.rst:432 +#: ../../library/re.rst:433 msgid "A comment; the contents of the parentheses are simply ignored." msgstr "" -#: ../../library/re.rst:439 +#: ../../library/re.rst:440 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../library/re.rst:437 +#: ../../library/re.rst:438 msgid "" "Matches if ``...`` matches next, but doesn't consume any of the string. " "This is called a :dfn:`lookahead assertion`. For example, ``Isaac (?" "=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:446 +#: ../../library/re.rst:447 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../library/re.rst:444 +#: ../../library/re.rst:445 msgid "" "Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead " "assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only " "if it's *not* followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:473 +#: ../../library/re.rst:474 msgid "``(?<=...)``" msgstr "``(?<=...)``" -#: ../../library/re.rst:451 +#: ../../library/re.rst:452 msgid "" "Matches if the current position in the string is preceded by a match for " "``...`` that ends at the current position. This is called a :dfn:`positive " @@ -656,19 +657,19 @@ msgid "" "func:`match` function:" msgstr "" -#: ../../library/re.rst:466 +#: ../../library/re.rst:467 msgid "This example looks for a word following a hyphen:" msgstr "" -#: ../../library/re.rst:472 +#: ../../library/re.rst:473 msgid "Added support for group references of fixed length." msgstr "" -#: ../../library/re.rst:482 +#: ../../library/re.rst:483 msgid "``(?'``." msgstr "" -#: ../../library/re.rst:495 +#: ../../library/re.rst:496 msgid "Group *id* containing anything except ASCII digits." msgstr "" -#: ../../library/re.rst:499 +#: ../../library/re.rst:500 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -703,11 +704,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:514 +#: ../../library/re.rst:515 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:507 +#: ../../library/re.rst:508 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -719,19 +720,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:519 +#: ../../library/re.rst:520 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:519 +#: ../../library/re.rst:520 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:535 +#: ../../library/re.rst:536 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:524 +#: ../../library/re.rst:525 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " "is defined as a sequence of word characters. Note that formally, ``\\b`` is " @@ -741,7 +742,7 @@ msgid "" "baz'`` but not ``'foobar'`` or ``'foo3'``." msgstr "" -#: ../../library/re.rst:531 +#: ../../library/re.rst:532 msgid "" "By default Unicode alphanumerics are the ones used in Unicode patterns, but " "this can be changed by using the :const:`ASCII` flag. Word boundaries are " @@ -750,11 +751,11 @@ msgid "" "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:546 +#: ../../library/re.rst:547 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:540 +#: ../../library/re.rst:541 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " "of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, " @@ -765,15 +766,15 @@ msgid "" "the :const:`LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:558 +#: ../../library/re.rst:559 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:555 ../../library/re.rst:575 ../../library/re.rst:594 +#: ../../library/re.rst:556 ../../library/re.rst:576 ../../library/re.rst:595 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:552 +#: ../../library/re.rst:553 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category [Nd]). This includes ``[0-9]``, and also many other " @@ -781,30 +782,30 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:558 ../../library/re.rst:579 ../../library/re.rst:600 +#: ../../library/re.rst:559 ../../library/re.rst:580 ../../library/re.rst:601 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:558 +#: ../../library/re.rst:559 msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." msgstr "" -#: ../../library/re.rst:565 +#: ../../library/re.rst:566 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:563 +#: ../../library/re.rst:564 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``. If the :const:`ASCII` flag is used this becomes the equivalent of " "``[^0-9]``." msgstr "" -#: ../../library/re.rst:579 +#: ../../library/re.rst:580 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:571 +#: ../../library/re.rst:572 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" @@ -812,35 +813,35 @@ msgid "" "const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" -#: ../../library/re.rst:578 +#: ../../library/re.rst:579 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:586 +#: ../../library/re.rst:587 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:584 +#: ../../library/re.rst:585 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the " "equivalent of ``[^ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:600 +#: ../../library/re.rst:601 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:592 +#: ../../library/re.rst:593 msgid "" "Matches Unicode word characters; this includes alphanumeric characters (as " "defined by :meth:`str.isalnum`) as well as the underscore (``_``). If the :" "const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched." msgstr "" -#: ../../library/re.rst:597 +#: ../../library/re.rst:598 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, " @@ -848,11 +849,11 @@ msgid "" "underscore." msgstr "" -#: ../../library/re.rst:609 +#: ../../library/re.rst:610 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:605 +#: ../../library/re.rst:606 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. If the :const:`ASCII` flag is used this becomes the equivalent of " @@ -860,34 +861,34 @@ msgid "" "which are neither alphanumeric in the current locale nor the underscore." msgstr "" -#: ../../library/re.rst:614 +#: ../../library/re.rst:615 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:614 +#: ../../library/re.rst:615 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:630 +#: ../../library/re.rst:631 msgid "" "Most of the standard escapes supported by Python string literals are also " "accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:637 +#: ../../library/re.rst:638 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:640 +#: ../../library/re.rst:641 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode patterns. In bytes patterns they are errors. Unknown escapes of " "ASCII letters are reserved for future use and treated as errors." msgstr "" -#: ../../library/re.rst:644 +#: ../../library/re.rst:645 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -895,26 +896,26 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:649 +#: ../../library/re.rst:650 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:652 +#: ../../library/re.rst:653 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:655 +#: ../../library/re.rst:656 msgid "" "The ``'\\N{name}'`` escape sequence has been added. As in string literals, " "it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." msgstr "" -#: ../../library/re.rst:663 +#: ../../library/re.rst:664 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:665 +#: ../../library/re.rst:666 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -922,26 +923,26 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:672 +#: ../../library/re.rst:673 msgid "Flags" msgstr "" -#: ../../library/re.rst:674 +#: ../../library/re.rst:675 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:681 +#: ../../library/re.rst:682 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:683 +#: ../../library/re.rst:684 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:688 +#: ../../library/re.rst:689 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -949,7 +950,7 @@ msgid "" "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:693 +#: ../../library/re.rst:694 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 ``(?" @@ -957,13 +958,13 @@ msgid "" "default for strings (and Unicode matching isn't allowed for bytes)." msgstr "" -#: ../../library/re.rst:702 +#: ../../library/re.rst:703 msgid "" "Display debug information about compiled expression. No corresponding inline " "flag." msgstr "" -#: ../../library/re.rst:709 +#: ../../library/re.rst:710 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -973,7 +974,7 @@ msgid "" "flag ``(?i)``." msgstr "" -#: ../../library/re.rst:716 +#: ../../library/re.rst:717 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 " @@ -984,7 +985,7 @@ msgid "" "matched." msgstr "" -#: ../../library/re.rst:727 +#: ../../library/re.rst:728 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " @@ -995,20 +996,20 @@ msgid "" "locales/languages. Corresponds to the inline flag ``(?L)``." msgstr "" -#: ../../library/re.rst:736 +#: ../../library/re.rst:737 msgid "" ":const:`re.LOCALE` can be used only with bytes patterns and is not " "compatible with :const:`re.ASCII`." msgstr "" -#: ../../library/re.rst:740 +#: ../../library/re.rst:741 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:749 +#: ../../library/re.rst:750 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1019,7 +1020,7 @@ msgid "" "the end of the string. Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:759 +#: ../../library/re.rst:760 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1027,14 +1028,14 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:772 +#: ../../library/re.rst:773 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:782 +#: ../../library/re.rst:783 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 " @@ -1047,53 +1048,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:792 +#: ../../library/re.rst:793 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:800 +#: ../../library/re.rst:801 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:804 +#: ../../library/re.rst:805 msgid "Functions" msgstr "" -#: ../../library/re.rst:808 +#: ../../library/re.rst:809 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:813 +#: ../../library/re.rst:814 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:817 +#: ../../library/re.rst:818 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:822 +#: ../../library/re.rst:823 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:826 +#: ../../library/re.rst:827 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:832 +#: ../../library/re.rst:833 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1101,7 +1102,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:840 +#: ../../library/re.rst:841 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1110,7 +1111,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:849 +#: ../../library/re.rst:850 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 " @@ -1138,7 +1139,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:873 +#: ../../library/re.rst:874 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 " @@ -1147,42 +1148,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:888 +#: ../../library/re.rst:889 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:895 +#: ../../library/re.rst:896 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:898 +#: ../../library/re.rst:899 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:908 ../../library/re.rst:998 ../../library/re.rst:1026 +#: ../../library/re.rst:909 ../../library/re.rst:999 ../../library/re.rst:1027 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:911 +#: ../../library/re.rst:912 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:917 +#: ../../library/re.rst:918 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:921 +#: ../../library/re.rst:922 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. " @@ -1192,11 +1193,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:933 ../../library/re.rst:944 +#: ../../library/re.rst:934 ../../library/re.rst:945 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:939 +#: ../../library/re.rst:940 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1204,7 +1205,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:950 +#: ../../library/re.rst:951 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1218,18 +1219,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:966 +#: ../../library/re.rst:967 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:978 +#: ../../library/re.rst:979 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:980 +#: ../../library/re.rst:981 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, " @@ -1238,7 +1239,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:988 +#: ../../library/re.rst:989 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1251,59 +1252,59 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1001 ../../library/re.rst:1029 -#: ../../library/re.rst:1263 +#: ../../library/re.rst:1002 ../../library/re.rst:1030 +#: ../../library/re.rst:1264 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1004 +#: ../../library/re.rst:1005 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1008 +#: ../../library/re.rst:1009 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1012 +#: ../../library/re.rst:1013 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1016 +#: ../../library/re.rst:1017 msgid "" "Group *id* containing anything except ASCII digits. Group names containing " "non-ASCII characters in bytes replacement strings." msgstr "" -#: ../../library/re.rst:1023 +#: ../../library/re.rst:1024 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1035 +#: ../../library/re.rst:1036 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:1050 +#: ../../library/re.rst:1051 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:1058 +#: ../../library/re.rst:1059 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1061 +#: ../../library/re.rst:1062 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1311,15 +1312,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1070 +#: ../../library/re.rst:1071 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1074 +#: ../../library/re.rst:1075 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1078 +#: ../../library/re.rst:1079 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 " @@ -1328,41 +1329,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1086 +#: ../../library/re.rst:1087 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1090 +#: ../../library/re.rst:1091 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1094 +#: ../../library/re.rst:1095 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1098 +#: ../../library/re.rst:1099 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1102 +#: ../../library/re.rst:1103 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1104 +#: ../../library/re.rst:1105 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1110 +#: ../../library/re.rst:1111 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1112 +#: ../../library/re.rst:1113 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1117 +#: ../../library/re.rst:1118 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1371,7 +1372,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1123 +#: ../../library/re.rst:1124 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 " @@ -1380,7 +1381,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1129 +#: ../../library/re.rst:1130 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 " @@ -1390,7 +1391,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1144 +#: ../../library/re.rst:1145 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1398,19 +1399,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1149 ../../library/re.rst:1167 +#: ../../library/re.rst:1150 ../../library/re.rst:1168 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1157 +#: ../../library/re.rst:1158 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:1163 +#: ../../library/re.rst:1164 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1418,76 +1419,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1181 +#: ../../library/re.rst:1182 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1186 +#: ../../library/re.rst:1187 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:1193 +#: ../../library/re.rst:1194 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:1200 +#: ../../library/re.rst:1201 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1205 +#: ../../library/re.rst:1206 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1210 +#: ../../library/re.rst:1211 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:1217 +#: ../../library/re.rst:1218 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1222 +#: ../../library/re.rst:1223 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:1229 +#: ../../library/re.rst:1230 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1232 +#: ../../library/re.rst:1233 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1240 +#: ../../library/re.rst:1241 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1242 +#: ../../library/re.rst:1243 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:1251 +#: ../../library/re.rst:1252 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1256 +#: ../../library/re.rst:1257 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1496,7 +1497,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1268 +#: ../../library/re.rst:1269 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 " @@ -1511,7 +1512,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1290 +#: ../../library/re.rst:1291 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1519,57 +1520,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1295 +#: ../../library/re.rst:1296 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1303 +#: ../../library/re.rst:1304 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1310 +#: ../../library/re.rst:1311 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1319 +#: ../../library/re.rst:1320 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1330 +#: ../../library/re.rst:1331 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1343 +#: ../../library/re.rst:1344 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:1347 ../../library/re.rst:1572 +#: ../../library/re.rst:1348 ../../library/re.rst:1573 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1353 +#: ../../library/re.rst:1354 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:1366 +#: ../../library/re.rst:1367 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:1378 +#: ../../library/re.rst:1379 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 " @@ -1578,7 +1579,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1386 +#: ../../library/re.rst:1387 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." @@ -1586,32 +1587,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1391 +#: ../../library/re.rst:1392 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1401 +#: ../../library/re.rst:1402 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:1408 +#: ../../library/re.rst:1409 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:1415 +#: ../../library/re.rst:1416 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:1422 +#: ../../library/re.rst:1423 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)" @@ -1620,43 +1621,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1431 +#: ../../library/re.rst:1432 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:1437 +#: ../../library/re.rst:1438 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1443 +#: ../../library/re.rst:1444 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1446 +#: ../../library/re.rst:1447 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1454 +#: ../../library/re.rst:1455 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1458 +#: ../../library/re.rst:1459 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1460 +#: ../../library/re.rst:1461 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1468 +#: ../../library/re.rst:1469 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 " @@ -1664,28 +1665,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1473 +#: ../../library/re.rst:1474 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1483 +#: ../../library/re.rst:1484 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:1493 +#: ../../library/re.rst:1494 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:1512 +#: ../../library/re.rst:1513 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1516 +#: ../../library/re.rst:1517 msgid "" "Python does not currently have an equivalent to :c:func:`scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1694,124 +1695,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1523 +#: ../../library/re.rst:1524 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1523 +#: ../../library/re.rst:1524 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1525 +#: ../../library/re.rst:1526 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1527 +#: ../../library/re.rst:1528 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1527 +#: ../../library/re.rst:1528 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1529 +#: ../../library/re.rst:1530 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1529 +#: ../../library/re.rst:1530 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1531 +#: ../../library/re.rst:1532 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1531 +#: ../../library/re.rst:1532 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1533 +#: ../../library/re.rst:1534 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1533 +#: ../../library/re.rst:1534 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1535 +#: ../../library/re.rst:1536 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1535 +#: ../../library/re.rst:1536 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1537 +#: ../../library/re.rst:1538 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1537 +#: ../../library/re.rst:1538 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1539 +#: ../../library/re.rst:1540 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1539 +#: ../../library/re.rst:1540 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1541 +#: ../../library/re.rst:1542 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1541 +#: ../../library/re.rst:1542 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1544 +#: ../../library/re.rst:1545 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1548 +#: ../../library/re.rst:1549 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1552 +#: ../../library/re.rst:1553 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1560 +#: ../../library/re.rst:1561 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1564 +#: ../../library/re.rst:1565 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1566 +#: ../../library/re.rst:1567 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1567 +#: ../../library/re.rst:1568 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1569 +#: ../../library/re.rst:1570 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1581 +#: ../../library/re.rst:1582 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:1589 +#: ../../library/re.rst:1590 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 " @@ -1819,11 +1820,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1599 +#: ../../library/re.rst:1600 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1601 +#: ../../library/re.rst:1602 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 " @@ -1831,37 +1832,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1606 +#: ../../library/re.rst:1607 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:1619 +#: ../../library/re.rst:1620 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:1632 +#: ../../library/re.rst:1633 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:1645 +#: ../../library/re.rst:1646 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:1660 +#: ../../library/re.rst:1661 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1662 +#: ../../library/re.rst:1663 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 " @@ -1869,11 +1870,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1679 +#: ../../library/re.rst:1680 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1681 +#: ../../library/re.rst:1682 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 " @@ -1881,11 +1882,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1692 +#: ../../library/re.rst:1693 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1694 +#: ../../library/re.rst:1695 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 " @@ -1894,11 +1895,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1708 +#: ../../library/re.rst:1709 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1710 +#: ../../library/re.rst:1711 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1906,7 +1907,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1720 +#: ../../library/re.rst:1721 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1914,29 +1915,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1732 +#: ../../library/re.rst:1733 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1734 +#: ../../library/re.rst:1735 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:1738 +#: ../../library/re.rst:1739 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:1794 +#: ../../library/re.rst:1795 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1817 +#: ../../library/re.rst:1818 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/sqlite3.po b/library/sqlite3.po index 552b2c0d79..1f43b8342e 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-11 00:15+0000\n" +"POT-Creation-Date: 2023-03-03 01:56+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -107,7 +107,7 @@ msgstr "" #: ../../library/sqlite3.rst:73 msgid "" "First, we need to create a new database and open a database connection to " -"allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to to " +"allow :mod:`!sqlite3` to work with it. Call :func:`sqlite3.connect` to " "create a connection to the database :file:`tutorial.db` in the current " "working directory, implicitly creating it if it does not exist:" msgstr "" diff --git a/library/stdtypes.po b/library/stdtypes.po index d65ee6909a..5eedb27511 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-02-22 00:16+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -145,7 +145,7 @@ msgid "``x or y``" msgstr "``x or y``" #: ../../library/stdtypes.rst:87 -msgid "if *x* is false, then *y*, else *x*" +msgid "if *x* is true, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 diff --git a/library/sys.po b/library/sys.po index c1edd60b17..606115a8e0 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-03-02 10:05+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-" @@ -346,8 +346,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:278 ../../library/sys.rst:873 -#: ../../library/sys.rst:1579 ../../library/sys.rst:1812 +#: ../../library/sys.rst:278 ../../library/sys.rst:879 +#: ../../library/sys.rst:1585 ../../library/sys.rst:1818 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -392,13 +392,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:335 ../../library/sys.rst:1020 -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:335 ../../library/sys.rst:1026 +#: ../../library/sys.rst:1701 msgid "Attribute" msgstr "屬性" -#: ../../library/sys.rst:335 ../../library/sys.rst:1020 -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:335 ../../library/sys.rst:1026 +#: ../../library/sys.rst:1701 msgid "Explanation" msgstr "解釋" @@ -632,7 +632,7 @@ msgid "" msgstr "" #: ../../library/sys.rst:515 ../../library/sys.rst:572 -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:925 msgid "attribute" msgstr "" @@ -819,17 +819,17 @@ msgstr "" msgid "float.h macro" msgstr "" -#: ../../library/sys.rst:572 ../../library/sys.rst:919 +#: ../../library/sys.rst:572 ../../library/sys.rst:925 msgid "explanation" msgstr "" #: ../../library/sys.rst:574 -msgid ":const:`epsilon`" -msgstr ":const:`epsilon`" +msgid "``epsilon``" +msgstr "``epsilon``" #: ../../library/sys.rst:574 -msgid "DBL_EPSILON" -msgstr "DBL_EPSILON" +msgid "``DBL_EPSILON``" +msgstr "``DBL_EPSILON``" #: ../../library/sys.rst:574 msgid "" @@ -842,12 +842,12 @@ msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`\\ 。" #: ../../library/sys.rst:579 -msgid ":const:`dig`" -msgstr ":const:`dig`" +msgid "``dig``" +msgstr "``dig``" #: ../../library/sys.rst:579 -msgid "DBL_DIG" -msgstr "DBL_DIG" +msgid "``DBL_DIG``" +msgstr "``DBL_DIG``" #: ../../library/sys.rst:579 msgid "" @@ -856,12 +856,12 @@ msgid "" msgstr "" #: ../../library/sys.rst:582 -msgid ":const:`mant_dig`" -msgstr ":const:`mant_dig`" +msgid "``mant_dig``" +msgstr "``mant_dig``" #: ../../library/sys.rst:582 -msgid "DBL_MANT_DIG" -msgstr "DBL_MANT_DIG" +msgid "``DBL_MANT_DIG``" +msgstr "``DBL_MANT_DIG``" #: ../../library/sys.rst:582 msgid "" @@ -870,24 +870,24 @@ msgid "" msgstr "" #: ../../library/sys.rst:585 -msgid ":const:`max`" -msgstr ":const:`max`" +msgid "``max``" +msgstr "``max``" #: ../../library/sys.rst:585 -msgid "DBL_MAX" -msgstr "DBL_MAX" +msgid "``DBL_MAX``" +msgstr "``DBL_MAX``" #: ../../library/sys.rst:585 msgid "maximum representable positive finite float" msgstr "" #: ../../library/sys.rst:587 -msgid ":const:`max_exp`" -msgstr ":const:`max_exp`" +msgid "``max_exp``" +msgstr "``max_exp``" #: ../../library/sys.rst:587 -msgid "DBL_MAX_EXP" -msgstr "DBL_MAX_EXP" +msgid "``DBL_MAX_EXP``" +msgstr "``DBL_MAX_EXP``" #: ../../library/sys.rst:587 msgid "" @@ -896,12 +896,12 @@ msgid "" msgstr "" #: ../../library/sys.rst:590 -msgid ":const:`max_10_exp`" -msgstr ":const:`max_10_exp`" +msgid "``max_10_exp``" +msgstr "``max_10_exp``" #: ../../library/sys.rst:590 -msgid "DBL_MAX_10_EXP" -msgstr "DBL_MAX_10_EXP" +msgid "``DBL_MAX_10_EXP``" +msgstr "``DBL_MAX_10_EXP``" #: ../../library/sys.rst:590 msgid "" @@ -910,12 +910,12 @@ msgid "" msgstr "" #: ../../library/sys.rst:593 -msgid ":const:`min`" -msgstr ":const:`min`" +msgid "``min``" +msgstr "``min``" #: ../../library/sys.rst:593 -msgid "DBL_MIN" -msgstr "DBL_MIN" +msgid "``DBL_MIN``" +msgstr "``DBL_MIN``" #: ../../library/sys.rst:593 msgid "minimum representable positive *normalized* float" @@ -928,58 +928,64 @@ msgid "" msgstr "" #: ../../library/sys.rst:599 -msgid ":const:`min_exp`" -msgstr ":const:`min_exp`" +msgid "``min_exp``" +msgstr "``min_exp``" #: ../../library/sys.rst:599 -msgid "DBL_MIN_EXP" -msgstr "DBL_MIN_EXP" +msgid "``DBL_MIN_EXP``" +msgstr "``DBL_MIN_EXP``" #: ../../library/sys.rst:599 msgid "minimum integer *e* such that ``radix**(e-1)`` is a normalized float" msgstr "" #: ../../library/sys.rst:602 -msgid ":const:`min_10_exp`" -msgstr ":const:`min_10_exp`" +msgid "``min_10_exp``" +msgstr "``min_10_exp``" #: ../../library/sys.rst:602 -msgid "DBL_MIN_10_EXP" -msgstr "DBL_MIN_10_EXP" +msgid "``DBL_MIN_10_EXP``" +msgstr "``DBL_MIN_10_EXP``" #: ../../library/sys.rst:602 msgid "minimum integer *e* such that ``10**e`` is a normalized float" msgstr "" #: ../../library/sys.rst:605 -msgid ":const:`radix`" -msgstr ":const:`radix`" +msgid "``radix``" +msgstr "``radix``" #: ../../library/sys.rst:605 -msgid "FLT_RADIX" -msgstr "FLT_RADIX" +msgid "``FLT_RADIX``" +msgstr "``FLT_RADIX``" #: ../../library/sys.rst:605 msgid "radix of exponent representation" msgstr "" #: ../../library/sys.rst:607 -msgid ":const:`rounds`" -msgstr ":const:`rounds`" +msgid "``rounds``" +msgstr "``rounds``" #: ../../library/sys.rst:607 -msgid "FLT_ROUNDS" -msgstr "FLT_ROUNDS" +msgid "``FLT_ROUNDS``" +msgstr "``FLT_ROUNDS``" #: ../../library/sys.rst:607 msgid "" -"integer constant representing the rounding mode used for arithmetic " -"operations. This reflects the value of the system FLT_ROUNDS macro at " -"interpreter startup time. See section 5.2.4.2.2 of the C99 standard for an " -"explanation of the possible values and their meanings." +"integer representing the rounding mode for floating-point arithmetic. This " +"reflects the value of the system ``FLT_ROUNDS`` macro at interpreter startup " +"time: ``-1`` indeterminable, ``0`` toward zero, ``1`` to nearest, ``2`` " +"toward positive infinity, ``3`` toward negative infinity" +msgstr "" + +#: ../../library/sys.rst:617 +msgid "" +"All other values for ``FLT_ROUNDS`` characterize implementation-defined " +"rounding behavior." msgstr "" -#: ../../library/sys.rst:615 +#: ../../library/sys.rst:621 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`sys." @@ -987,13 +993,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:628 +#: ../../library/sys.rst:634 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:637 +#: ../../library/sys.rst:643 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1003,7 +1009,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:650 +#: ../../library/sys.rst:656 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1013,38 +1019,38 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:657 +#: ../../library/sys.rst:663 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:671 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:667 +#: ../../library/sys.rst:673 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:674 +#: ../../library/sys.rst:680 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:680 +#: ../../library/sys.rst:686 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:685 ../../library/sys.rst:1341 +#: ../../library/sys.rst:691 ../../library/sys.rst:1347 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:690 +#: ../../library/sys.rst:696 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:723 +#: ../../library/sys.rst:729 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1099,20 +1105,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:741 +#: ../../library/sys.rst:747 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:748 +#: ../../library/sys.rst:754 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:755 +#: ../../library/sys.rst:761 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1120,46 +1126,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:763 +#: ../../library/sys.rst:769 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:768 +#: ../../library/sys.rst:774 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:771 +#: ../../library/sys.rst:777 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:774 +#: ../../library/sys.rst:780 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:778 +#: ../../library/sys.rst:784 msgid "" "See `recursive sizeof recipe `_ " "for an example of using :func:`getsizeof` recursively to find the size of " "containers and all their contents." msgstr "" -#: ../../library/sys.rst:784 +#: ../../library/sys.rst:790 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:792 +#: ../../library/sys.rst:798 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1174,21 +1180,21 @@ msgid "" "``frame``." msgstr "" -#: ../../library/sys.rst:801 +#: ../../library/sys.rst:807 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:811 +#: ../../library/sys.rst:817 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:820 +#: ../../library/sys.rst:826 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:824 +#: ../../library/sys.rst:830 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1196,7 +1202,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:832 +#: ../../library/sys.rst:838 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1208,54 +1214,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:843 +#: ../../library/sys.rst:849 msgid "*platform* will be :const:`2 (VER_PLATFORM_WIN32_NT)`." msgstr "" -#: ../../library/sys.rst:845 +#: ../../library/sys.rst:851 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:854 msgid "Constant" msgstr "" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:854 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:850 +#: ../../library/sys.rst:856 msgid ":const:`1 (VER_NT_WORKSTATION)`" msgstr ":const:`1 (VER_NT_WORKSTATION)`" -#: ../../library/sys.rst:850 +#: ../../library/sys.rst:856 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:852 +#: ../../library/sys.rst:858 msgid ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" msgstr ":const:`2 (VER_NT_DOMAIN_CONTROLLER)`" -#: ../../library/sys.rst:852 +#: ../../library/sys.rst:858 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:855 +#: ../../library/sys.rst:861 msgid ":const:`3 (VER_NT_SERVER)`" msgstr ":const:`3 (VER_NT_SERVER)`" -#: ../../library/sys.rst:855 +#: ../../library/sys.rst:861 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:859 +#: ../../library/sys.rst:865 msgid "" "This function wraps the Win32 :c:func:`GetVersionEx` function; see the " "Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:863 +#: ../../library/sys.rst:869 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1263,24 +1269,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:869 +#: ../../library/sys.rst:875 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:875 +#: ../../library/sys.rst:881 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:879 +#: ../../library/sys.rst:885 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:885 +#: ../../library/sys.rst:891 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1290,103 +1296,103 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:892 +#: ../../library/sys.rst:898 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:896 ../../library/sys.rst:1543 +#: ../../library/sys.rst:902 ../../library/sys.rst:1549 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:902 +#: ../../library/sys.rst:908 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:908 ../../library/sys.rst:1564 +#: ../../library/sys.rst:914 ../../library/sys.rst:1570 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:914 +#: ../../library/sys.rst:920 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:921 +#: ../../library/sys.rst:927 msgid ":const:`width`" msgstr ":const:`width`" -#: ../../library/sys.rst:921 +#: ../../library/sys.rst:927 msgid "width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:929 msgid ":const:`modulus`" msgstr ":const:`modulus`" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:929 msgid "prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:925 +#: ../../library/sys.rst:931 msgid ":const:`inf`" msgstr ":const:`inf`" -#: ../../library/sys.rst:925 +#: ../../library/sys.rst:931 msgid "hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:933 msgid ":const:`nan`" msgstr ":const:`nan`" -#: ../../library/sys.rst:927 +#: ../../library/sys.rst:933 msgid "(this attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:935 msgid ":const:`imag`" msgstr ":const:`imag`" -#: ../../library/sys.rst:929 +#: ../../library/sys.rst:935 msgid "multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:932 +#: ../../library/sys.rst:938 msgid ":const:`algorithm`" msgstr ":const:`algorithm`" -#: ../../library/sys.rst:932 +#: ../../library/sys.rst:938 msgid "name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:941 msgid ":const:`hash_bits`" msgstr ":const:`hash_bits`" -#: ../../library/sys.rst:935 +#: ../../library/sys.rst:941 msgid "internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:937 +#: ../../library/sys.rst:943 msgid ":const:`seed_bits`" msgstr ":const:`seed_bits`" -#: ../../library/sys.rst:937 +#: ../../library/sys.rst:943 msgid "size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:943 +#: ../../library/sys.rst:949 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:955 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1394,7 +1400,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:960 +#: ../../library/sys.rst:966 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1402,25 +1408,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:965 +#: ../../library/sys.rst:971 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:970 +#: ../../library/sys.rst:976 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:980 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:978 +#: ../../library/sys.rst:984 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1432,13 +1438,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:988 +#: ../../library/sys.rst:994 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:991 +#: ../../library/sys.rst:997 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1447,7 +1453,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:998 +#: ../../library/sys.rst:1004 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1457,61 +1463,61 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1009 +#: ../../library/sys.rst:1015 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1014 +#: ../../library/sys.rst:1020 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1022 +#: ../../library/sys.rst:1028 msgid ":const:`bits_per_digit`" msgstr ":const:`bits_per_digit`" -#: ../../library/sys.rst:1022 +#: ../../library/sys.rst:1028 msgid "" "number of bits held in each digit. Python integers are stored internally in " "base ``2**int_info.bits_per_digit``" msgstr "" -#: ../../library/sys.rst:1026 +#: ../../library/sys.rst:1032 msgid ":const:`sizeof_digit`" msgstr ":const:`sizeof_digit`" -#: ../../library/sys.rst:1026 +#: ../../library/sys.rst:1032 msgid "size in bytes of the C type used to represent a digit" msgstr "" -#: ../../library/sys.rst:1029 +#: ../../library/sys.rst:1035 msgid ":const:`default_max_str_digits`" msgstr ":const:`default_max_str_digits`" -#: ../../library/sys.rst:1029 +#: ../../library/sys.rst:1035 msgid "" "default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1033 +#: ../../library/sys.rst:1039 msgid ":const:`str_digits_check_threshold`" msgstr ":const:`str_digits_check_threshold`" -#: ../../library/sys.rst:1033 +#: ../../library/sys.rst:1039 msgid "" "minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1041 +#: ../../library/sys.rst:1047 msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1053 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1064 +#: ../../library/sys.rst:1070 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1544,19 +1550,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1072 +#: ../../library/sys.rst:1078 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1084 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1088 +#: ../../library/sys.rst:1094 msgid "" "These three variables are not always defined; they are set when an exception " "is not handled and the interpreter prints an error message and a stack " @@ -1567,33 +1573,33 @@ msgid "" "information.)" msgstr "" -#: ../../library/sys.rst:1096 +#: ../../library/sys.rst:1102 msgid "" "The meaning of the variables is the same as that of the return values from :" "func:`exc_info` above." msgstr "" -#: ../../library/sys.rst:1102 +#: ../../library/sys.rst:1108 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1109 +#: ../../library/sys.rst:1115 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1112 +#: ../../library/sys.rst:1118 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1120 +#: ../../library/sys.rst:1126 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1606,27 +1612,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1133 +#: ../../library/sys.rst:1139 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1133 +#: ../../library/sys.rst:1139 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1137 +#: ../../library/sys.rst:1143 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1142 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1142 +#: ../../library/sys.rst:1148 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:" @@ -1635,7 +1641,7 @@ msgid "" "MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1150 +#: ../../library/sys.rst:1156 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1647,78 +1653,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1162 +#: ../../library/sys.rst:1168 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1165 +#: ../../library/sys.rst:1171 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1174 +#: ../../library/sys.rst:1180 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1178 +#: ../../library/sys.rst:1184 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1182 +#: ../../library/sys.rst:1188 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1184 +#: ../../library/sys.rst:1190 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1186 +#: ../../library/sys.rst:1192 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1189 +#: ../../library/sys.rst:1195 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1192 +#: ../../library/sys.rst:1198 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1198 +#: ../../library/sys.rst:1204 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1203 +#: ../../library/sys.rst:1209 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1207 ../../library/sys.rst:1218 +#: ../../library/sys.rst:1213 ../../library/sys.rst:1224 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1218 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1726,19 +1732,19 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1220 +#: ../../library/sys.rst:1226 msgid "" "``None`` is stored instead of :class:`imp.NullImporter` when no finder is " "found." msgstr "" -#: ../../library/sys.rst:1227 +#: ../../library/sys.rst:1233 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1230 +#: ../../library/sys.rst:1236 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1747,75 +1753,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1249 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1252 msgid "System" msgstr "" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1252 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1248 +#: ../../library/sys.rst:1254 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1248 +#: ../../library/sys.rst:1254 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1249 +#: ../../library/sys.rst:1255 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1249 +#: ../../library/sys.rst:1255 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1250 +#: ../../library/sys.rst:1256 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1250 +#: ../../library/sys.rst:1256 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1251 +#: ../../library/sys.rst:1257 msgid "WASI" -msgstr "" +msgstr "WASI" -#: ../../library/sys.rst:1251 +#: ../../library/sys.rst:1257 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1258 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1258 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1253 +#: ../../library/sys.rst:1259 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1253 +#: ../../library/sys.rst:1259 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1260 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1260 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1257 +#: ../../library/sys.rst:1263 msgid "" "On Linux, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1823,7 +1829,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1263 +#: ../../library/sys.rst:1269 msgid "" "On AIX, :attr:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1831,57 +1837,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1271 +#: ../../library/sys.rst:1277 msgid "" ":attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1274 +#: ../../library/sys.rst:1280 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1280 +#: ../../library/sys.rst:1286 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1283 +#: ../../library/sys.rst:1289 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1293 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1289 +#: ../../library/sys.rst:1295 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1298 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1300 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1302 +#: ../../library/sys.rst:1308 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is ``'/usr/" @@ -1890,14 +1896,14 @@ msgid "" "paths." msgstr "" -#: ../../library/sys.rst:1308 +#: ../../library/sys.rst:1314 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1329 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1907,7 +1913,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1333 +#: ../../library/sys.rst:1339 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1918,14 +1924,14 @@ msgid "" "data:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1345 +#: ../../library/sys.rst:1351 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1363 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1940,7 +1946,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1368 +#: ../../library/sys.rst:1374 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1954,65 +1960,65 @@ msgid "" "arguments." msgstr "" -#: ../../library/sys.rst:1375 ../../library/sys.rst:1456 +#: ../../library/sys.rst:1381 ../../library/sys.rst:1462 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1379 ../../library/sys.rst:1461 +#: ../../library/sys.rst:1385 ../../library/sys.rst:1467 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1378 +#: ../../library/sys.rst:1384 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1384 ../../library/sys.rst:1476 +#: ../../library/sys.rst:1390 ../../library/sys.rst:1482 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1382 +#: ../../library/sys.rst:1388 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1394 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1393 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1397 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1397 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1399 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1394 +#: ../../library/sys.rst:1400 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1398 +#: ../../library/sys.rst:1404 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1402 +#: ../../library/sys.rst:1408 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -2020,19 +2026,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1407 +#: ../../library/sys.rst:1413 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1410 +#: ../../library/sys.rst:1416 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1417 +#: ../../library/sys.rst:1423 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2043,7 +2049,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1434 +#: ../../library/sys.rst:1440 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2052,7 +2058,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1445 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2060,7 +2066,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1444 +#: ../../library/sys.rst:1450 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2068,31 +2074,31 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1449 +#: ../../library/sys.rst:1455 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1453 +#: ../../library/sys.rst:1459 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1459 +#: ../../library/sys.rst:1465 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1470 +#: ../../library/sys.rst:1476 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1464 +#: ../../library/sys.rst:1470 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2102,7 +2108,7 @@ msgid "" "const:`False` on that frame." msgstr "" -#: ../../library/sys.rst:1473 +#: ../../library/sys.rst:1479 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2110,22 +2116,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1481 +#: ../../library/sys.rst:1487 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1479 +#: ../../library/sys.rst:1485 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1489 +#: ../../library/sys.rst:1495 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1484 +#: ../../library/sys.rst:1490 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2134,13 +2140,13 @@ msgid "" "`f_trace_opcodes` to :const:`True` on the frame." msgstr "" -#: ../../library/sys.rst:1491 +#: ../../library/sys.rst:1497 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1494 +#: ../../library/sys.rst:1500 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2154,7 +2160,7 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1505 +#: ../../library/sys.rst:1511 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" @@ -2164,7 +2170,7 @@ msgid "" "arguments." msgstr "" -#: ../../library/sys.rst:1511 +#: ../../library/sys.rst:1517 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2172,13 +2178,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1518 +#: ../../library/sys.rst:1524 msgid "" "``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" "`f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1523 +#: ../../library/sys.rst:1529 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2199,20 +2205,20 @@ msgid "" "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -#: ../../library/sys.rst:1533 +#: ../../library/sys.rst:1539 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1536 +#: ../../library/sys.rst:1542 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1548 +#: ../../library/sys.rst:1554 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2221,74 +2227,74 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1561 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1565 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1569 +#: ../../library/sys.rst:1575 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1573 +#: ../../library/sys.rst:1579 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1576 +#: ../../library/sys.rst:1582 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1581 +#: ../../library/sys.rst:1587 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1588 +#: ../../library/sys.rst:1594 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1591 +#: ../../library/sys.rst:1597 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1593 +#: ../../library/sys.rst:1599 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1601 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1603 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1601 +#: ../../library/sys.rst:1607 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1610 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2299,14 +2305,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1613 +#: ../../library/sys.rst:1619 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1618 +#: ../../library/sys.rst:1624 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2315,7 +2321,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1625 +#: ../../library/sys.rst:1631 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2324,19 +2330,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1637 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1643 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1641 +#: ../../library/sys.rst:1647 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2344,7 +2350,7 @@ msgid "" "support the :attr:`~io.BufferedIOBase.buffer` attribute." msgstr "" -#: ../../library/sys.rst:1651 +#: ../../library/sys.rst:1657 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2352,7 +2358,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1656 +#: ../../library/sys.rst:1662 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2360,7 +2366,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1662 +#: ../../library/sys.rst:1668 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2368,12 +2374,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1670 +#: ../../library/sys.rst:1676 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1672 +#: ../../library/sys.rst:1678 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2381,7 +2387,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1677 +#: ../../library/sys.rst:1683 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2389,72 +2395,72 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1682 +#: ../../library/sys.rst:1688 msgid "See also the :attr:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1695 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1697 +#: ../../library/sys.rst:1703 msgid ":const:`name`" msgstr ":const:`name`" -#: ../../library/sys.rst:1697 +#: ../../library/sys.rst:1703 msgid "Name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1705 msgid "``'nt'``: Windows threads" msgstr "" -#: ../../library/sys.rst:1700 +#: ../../library/sys.rst:1706 msgid "``'pthread'``: POSIX threads" msgstr "" -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1707 msgid "" "``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1709 msgid "``'solaris'``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1711 msgid ":const:`lock`" msgstr ":const:`lock`" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1711 msgid "Name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1713 msgid "``'semaphore'``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1708 +#: ../../library/sys.rst:1714 msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1710 +#: ../../library/sys.rst:1716 msgid "``None`` if this information is unknown" msgstr "" -#: ../../library/sys.rst:1712 +#: ../../library/sys.rst:1718 msgid ":const:`version`" msgstr ":const:`version`" -#: ../../library/sys.rst:1712 +#: ../../library/sys.rst:1718 msgid "" "Name and version of the thread library. It is a string, or ``None`` if this " "information is unknown." msgstr "" -#: ../../library/sys.rst:1721 +#: ../../library/sys.rst:1727 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2463,68 +2469,68 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1735 msgid "Handle an unraisable exception." msgstr "" -#: ../../library/sys.rst:1731 +#: ../../library/sys.rst:1737 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1741 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1743 msgid "*exc_type*: Exception type." msgstr "" -#: ../../library/sys.rst:1738 +#: ../../library/sys.rst:1744 msgid "*exc_value*: Exception value, can be ``None``." msgstr "" -#: ../../library/sys.rst:1739 +#: ../../library/sys.rst:1745 msgid "*exc_traceback*: Exception traceback, can be ``None``." msgstr "" -#: ../../library/sys.rst:1740 +#: ../../library/sys.rst:1746 msgid "*err_msg*: Error message, can be ``None``." msgstr "" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1747 msgid "*object*: Object causing the exception, can be ``None``." msgstr "" -#: ../../library/sys.rst:1743 +#: ../../library/sys.rst:1749 msgid "" "The default hook formats *err_msg* and *object* as: ``f'{err_msg}: {object!" "r}'``; use \"Exception ignored in\" error message if *err_msg* is ``None``." msgstr "" -#: ../../library/sys.rst:1747 +#: ../../library/sys.rst:1753 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1750 +#: ../../library/sys.rst:1756 msgid "" "Storing *exc_value* using a custom hook can create a reference cycle. It " "should be cleared explicitly to break the reference cycle when the exception " "is no longer needed." msgstr "" -#: ../../library/sys.rst:1754 +#: ../../library/sys.rst:1760 msgid "" "Storing *object* using a custom hook can resurrect it if it is set to an " "object which is being finalized. Avoid storing *object* after the custom " "hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1758 +#: ../../library/sys.rst:1764 msgid "See also :func:`excepthook` which handles uncaught exceptions." msgstr "" @@ -2534,7 +2540,7 @@ msgid "" "arguments ``hook``, ``unraisable``." msgstr "" -#: ../../library/sys.rst:1762 +#: ../../library/sys.rst:1768 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments ``hook``, " "``unraisable`` when an exception that cannot be handled occurs. The " @@ -2542,7 +2548,7 @@ msgid "" "hook has been set, ``hook`` may be ``None``." msgstr "" -#: ../../library/sys.rst:1771 +#: ../../library/sys.rst:1777 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2551,13 +2557,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1786 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1786 +#: ../../library/sys.rst:1792 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2568,18 +2574,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1794 +#: ../../library/sys.rst:1800 msgid "Added named component attributes." msgstr "" -#: ../../library/sys.rst:1799 +#: ../../library/sys.rst:1805 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1806 +#: ../../library/sys.rst:1812 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2588,25 +2594,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1817 +#: ../../library/sys.rst:1823 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1833 +#: ../../library/sys.rst:1839 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1841 +#: ../../library/sys.rst:1847 msgid "Citations" msgstr "" -#: ../../library/sys.rst:1842 +#: ../../library/sys.rst:1848 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" diff --git a/library/traceback.po b/library/traceback.po index f8ae935e92..d9bef8f1f0 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-05 00:18+0000\n" +"POT-Creation-Date: 2023-02-22 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,34 +37,34 @@ msgstr "" #: ../../library/traceback.rst:19 msgid "" -"The module uses traceback objects --- this is the object type that is stored " -"in the :data:`sys.last_traceback` variable and returned as the third item " -"from :func:`sys.exc_info`." +"The module uses traceback objects --- these are objects of type :class:" +"`types.TracebackType`, which are assigned to the ``__traceback__`` field of :" +"class:`BaseException` instances." msgstr "" -#: ../../library/traceback.rst:26 +#: ../../library/traceback.rst:25 msgid "Module :mod:`faulthandler`" msgstr "" -#: ../../library/traceback.rst:26 +#: ../../library/traceback.rst:25 msgid "" "Used to dump Python tracebacks explicitly, on a fault, after a timeout, or " "on a user signal." msgstr "" -#: ../../library/traceback.rst:28 +#: ../../library/traceback.rst:27 msgid "Module :mod:`pdb`" msgstr "" -#: ../../library/traceback.rst:29 +#: ../../library/traceback.rst:28 msgid "Interactive source code debugger for Python programs." msgstr "" -#: ../../library/traceback.rst:31 +#: ../../library/traceback.rst:30 msgid "The module defines the following functions:" msgstr "" -#: ../../library/traceback.rst:35 +#: ../../library/traceback.rst:34 msgid "" "Print up to *limit* stack trace entries from traceback object *tb* (starting " "from the caller's frame) if *limit* is positive. Otherwise, print the last " @@ -74,41 +74,41 @@ msgid "" "the output." msgstr "" -#: ../../library/traceback.rst:42 ../../library/traceback.rst:105 +#: ../../library/traceback.rst:41 ../../library/traceback.rst:104 msgid "Added negative *limit* support." msgstr "" -#: ../../library/traceback.rst:49 +#: ../../library/traceback.rst:48 msgid "" "Print exception information and stack trace entries from traceback object " "*tb* to *file*. This differs from :func:`print_tb` in the following ways:" msgstr "" -#: ../../library/traceback.rst:53 +#: ../../library/traceback.rst:52 msgid "" "if *tb* is not ``None``, it prints a header ``Traceback (most recent call " "last):``" msgstr "" -#: ../../library/traceback.rst:56 +#: ../../library/traceback.rst:55 msgid "it prints the exception type and *value* after the stack trace" msgstr "" -#: ../../library/traceback.rst:60 +#: ../../library/traceback.rst:59 msgid "" "if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate " "format, it prints the line where the syntax error occurred with a caret " "indicating the approximate position of the error." msgstr "" -#: ../../library/traceback.rst:64 +#: ../../library/traceback.rst:63 msgid "" "Since Python 3.10, instead of passing *value* and *tb*, an exception object " "can be passed as the first argument. If *value* and *tb* are provided, the " "first argument is ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:68 +#: ../../library/traceback.rst:67 msgid "" "The optional *limit* argument has the same meaning as for :func:`print_tb`. " "If *chain* is true (the default), then chained exceptions (the :attr:" @@ -117,29 +117,29 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:74 ../../library/traceback.rst:167 +#: ../../library/traceback.rst:73 ../../library/traceback.rst:166 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: ../../library/traceback.rst:77 ../../library/traceback.rst:154 +#: ../../library/traceback.rst:76 ../../library/traceback.rst:153 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" -#: ../../library/traceback.rst:84 +#: ../../library/traceback.rst:83 msgid "" -"This is a shorthand for ``print_exception(*sys.exc_info(), limit, file, " +"This is a shorthand for ``print_exception(sys.exception(), limit, file, " "chain)``." msgstr "" -#: ../../library/traceback.rst:90 +#: ../../library/traceback.rst:89 msgid "" "This is a shorthand for ``print_exception(sys.last_type, sys.last_value, sys." "last_traceback, limit, file, chain)``. In general it will work only after " "an exception has reached an interactive prompt (see :data:`sys.last_type`)." msgstr "" -#: ../../library/traceback.rst:98 +#: ../../library/traceback.rst:97 msgid "" "Print up to *limit* stack trace entries (starting from the invocation point) " "if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. " @@ -148,7 +148,7 @@ msgid "" "optional *file* argument has the same meaning as for :func:`print_tb`." msgstr "" -#: ../../library/traceback.rst:111 +#: ../../library/traceback.rst:110 msgid "" "Return a :class:`StackSummary` object representing a list of \"pre-" "processed\" stack trace entries extracted from the traceback object *tb*. " @@ -162,14 +162,14 @@ msgid "" "stripped; if the source is not available it is ``None``." msgstr "" -#: ../../library/traceback.rst:125 +#: ../../library/traceback.rst:124 msgid "" "Extract the raw traceback from the current stack frame. The return value " "has the same format as for :func:`extract_tb`. The optional *f* and *limit* " "arguments have the same meaning as for :func:`print_stack`." msgstr "" -#: ../../library/traceback.rst:132 +#: ../../library/traceback.rst:131 msgid "" "Given a list of tuples or :class:`FrameSummary` objects as returned by :func:" "`extract_tb` or :func:`extract_stack`, return a list of strings ready for " @@ -179,7 +179,7 @@ msgid "" "text line is not ``None``." msgstr "" -#: ../../library/traceback.rst:142 +#: ../../library/traceback.rst:141 msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " @@ -190,14 +190,14 @@ msgid "" "the list." msgstr "" -#: ../../library/traceback.rst:150 +#: ../../library/traceback.rst:149 msgid "" "Since Python 3.10, instead of passing *value*, an exception object can be " "passed as the first argument. If *value* is provided, the first argument is " "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:161 +#: ../../library/traceback.rst:160 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -206,66 +206,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:170 +#: ../../library/traceback.rst:169 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:177 +#: ../../library/traceback.rst:176 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:183 +#: ../../library/traceback.rst:182 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:188 +#: ../../library/traceback.rst:187 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:192 +#: ../../library/traceback.rst:191 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:199 +#: ../../library/traceback.rst:198 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:207 +#: ../../library/traceback.rst:206 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:212 +#: ../../library/traceback.rst:211 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:215 +#: ../../library/traceback.rst:214 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:219 +#: ../../library/traceback.rst:218 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:224 ../../library/traceback.rst:284 +#: ../../library/traceback.rst:223 ../../library/traceback.rst:283 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:227 +#: ../../library/traceback.rst:226 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -273,122 +273,122 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:232 ../../library/traceback.rst:287 +#: ../../library/traceback.rst:231 ../../library/traceback.rst:286 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:236 +#: ../../library/traceback.rst:235 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:240 +#: ../../library/traceback.rst:239 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:244 +#: ../../library/traceback.rst:243 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:248 +#: ../../library/traceback.rst:247 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:256 +#: ../../library/traceback.rst:255 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:260 +#: ../../library/traceback.rst:259 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:264 +#: ../../library/traceback.rst:263 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:268 +#: ../../library/traceback.rst:267 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:271 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:276 +#: ../../library/traceback.rst:275 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:280 +#: ../../library/traceback.rst:279 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:291 +#: ../../library/traceback.rst:290 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:298 +#: ../../library/traceback.rst:297 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:300 +#: ../../library/traceback.rst:299 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:303 +#: ../../library/traceback.rst:302 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:307 ../../library/traceback.rst:321 +#: ../../library/traceback.rst:306 ../../library/traceback.rst:320 msgid "" "The message indicating which exception occurred is always the last string in " "the output." msgstr "" -#: ../../library/traceback.rst:312 +#: ../../library/traceback.rst:311 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:314 +#: ../../library/traceback.rst:313 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:316 +#: ../../library/traceback.rst:315 msgid "" "Normally, the generator emits a single string; however, for :exc:" "`SyntaxError` exceptions, it emits several lines that (when printed) display " "detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:324 +#: ../../library/traceback.rst:323 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:328 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:333 +#: ../../library/traceback.rst:332 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:339 +#: ../../library/traceback.rst:338 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:343 +#: ../../library/traceback.rst:342 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -398,14 +398,14 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:353 +#: ../../library/traceback.rst:352 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:359 +#: ../../library/traceback.rst:358 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -413,18 +413,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:364 +#: ../../library/traceback.rst:363 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:368 +#: ../../library/traceback.rst:367 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:373 +#: ../../library/traceback.rst:372 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -432,16 +432,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:382 +#: ../../library/traceback.rst:381 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:385 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:390 +#: ../../library/traceback.rst:389 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -454,11 +454,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:403 +#: ../../library/traceback.rst:402 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:405 +#: ../../library/traceback.rst:404 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -466,22 +466,22 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:427 +#: ../../library/traceback.rst:426 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:462 +#: ../../library/traceback.rst:461 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:504 +#: ../../library/traceback.rst:503 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:530 +#: ../../library/traceback.rst:529 msgid "This last example demonstrates the final few formatting functions:" msgstr "" diff --git a/library/turtle.po b/library/turtle.po index 93aeec3950..305a40ae75 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-02-23 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -445,7 +445,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2457 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -1240,9 +1240,10 @@ msgstr "" msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " -"shape dictionary. Initially there are the following polygon shapes: \"arrow" -"\", \"turtle\", \"circle\", \"square\", \"triangle\", \"classic\". To learn " -"about how to deal with shapes see Screen method :func:`register_shape`." +"shape dictionary. Initially there are the following polygon shapes: " +"\"arrow\", \"turtle\", \"circle\", \"square\", \"triangle\", \"classic\". " +"To learn about how to deal with shapes see Screen method :func:" +"`register_shape`." msgstr "" #: ../../library/turtle.rst:1181 @@ -2437,61 +2438,61 @@ msgid "compound shapes, :class:`Vec2D`" msgstr "" #: ../../library/turtle.rst:2447 +msgid "rosette" +msgstr "" + +#: ../../library/turtle.rst:2447 +msgid "a pattern from the wikipedia article on turtle graphics" +msgstr "" + +#: ../../library/turtle.rst:2447 +msgid ":func:`clone`, :func:`undo`" +msgstr ":func:`clone`, :func:`undo`" + +#: ../../library/turtle.rst:2450 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2450 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2450 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2454 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2454 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2451 +#: ../../library/turtle.rst:2454 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2457 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2454 +#: ../../library/turtle.rst:2457 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2460 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2457 -msgid "simple design" -msgstr "" - -#: ../../library/turtle.rst:2457 -msgid "turtles on two canvases" -msgstr "" - #: ../../library/turtle.rst:2460 -msgid "wikipedia" +msgid "simple design" msgstr "" #: ../../library/turtle.rst:2460 -msgid "a pattern from the wikipedia article on turtle graphics" +msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2460 -msgid ":func:`clone`, :func:`undo`" -msgstr ":func:`clone`, :func:`undo`" - #: ../../library/turtle.rst:2463 msgid "yinyang" msgstr "" diff --git a/library/types.po b/library/types.po index 327e5d470d..76b6a97fb9 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-02-28 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -366,7 +366,9 @@ msgid "The type of :ref:`union type expressions`." msgstr "" #: ../../library/types.rst:323 -msgid "The type of traceback objects such as found in ``sys.exc_info()[2]``." +msgid "" +"The type of traceback objects such as found in ``sys.exception()." +"__traceback__``." msgstr "" #: ../../library/types.rst:325 @@ -536,7 +538,8 @@ msgid "" "`coroutine function` which returns a generator-based coroutine. The " "generator-based coroutine is still a :term:`generator iterator`, but is also " "considered to be a :term:`coroutine` object and is :term:`awaitable`. " -"However, it may not necessarily implement the :meth:`__await__` method." +"However, it may not necessarily implement the :meth:`~object.__await__` " +"method." msgstr "" #: ../../library/types.rst:485 diff --git a/library/typing.po b/library/typing.po index 25cc788b74..8adca57a88 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-02-26 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1508,9 +1508,9 @@ msgid "" ":func:`runtime_checkable` will check only the presence of the required " "methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " "class, therefore it passes an :func:`issubclass` check against :data:" -"`Callable`. However, the :meth:`ssl.SSLObject.__init__` method exists only " -"to raise a :exc:`TypeError` with a more informative message, therefore " -"making it impossible to call (instantiate) :class:`ssl.SSLObject`." +"`Callable`. However, the ``ssl.SSLObject.__init__`` method exists only to " +"raise a :exc:`TypeError` with a more informative message, therefore making " +"it impossible to call (instantiate) :class:`ssl.SSLObject`." msgstr "" #: ../../library/typing.rst:1598 diff --git a/library/wsgiref.po b/library/wsgiref.po index 649205a079..ef144233d5 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2023-02-22 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -740,9 +740,9 @@ msgstr "" #: ../../library/wsgiref.rst:677 msgid "" -"This method can access the current error information using ``sys." -"exc_info()``, and should pass that information to *start_response* when " -"calling it (as described in the \"Error Handling\" section of :pep:`3333`)." +"This method can access the current error using ``sys.exception()``, and " +"should pass that information to *start_response* when calling it (as " +"described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" #: ../../library/wsgiref.rst:681 diff --git a/library/zipfile.po b/library/zipfile.po index 6fd3c7394d..491c500f49 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-21 00:16+0000\n" +"POT-Creation-Date: 2023-02-26 00:19+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,15 +70,16 @@ msgstr "" #: ../../library/zipfile.rst:58 msgid "" -"A pathlib-compatible wrapper for zip files. See section :ref:`path-objects` " -"for details." +"Class that implements a subset of the interface provided by :class:`pathlib." +"Path`, including the full :class:`importlib.resources.abc.Traversable` " +"interface." msgstr "" -#: ../../library/zipfile.rst:67 +#: ../../library/zipfile.rst:68 msgid "Class for creating ZIP archives containing Python libraries." msgstr "" -#: ../../library/zipfile.rst:72 +#: ../../library/zipfile.rst:73 msgid "" "Class used to represent information about a member of an archive. Instances " "of this class are returned by the :meth:`.getinfo` and :meth:`.infolist` " @@ -90,40 +91,40 @@ msgid "" "ref:`zipinfo-objects`." msgstr "" -#: ../../library/zipfile.rst:83 +#: ../../library/zipfile.rst:84 msgid "" "Returns ``True`` if *filename* is a valid ZIP file based on its magic " "number, otherwise returns ``False``. *filename* may be a file or file-like " "object too." msgstr "" -#: ../../library/zipfile.rst:86 +#: ../../library/zipfile.rst:87 msgid "Support for file and file-like objects." msgstr "" -#: ../../library/zipfile.rst:92 +#: ../../library/zipfile.rst:93 msgid "The numeric constant for an uncompressed archive member." msgstr "" -#: ../../library/zipfile.rst:97 +#: ../../library/zipfile.rst:98 msgid "" "The numeric constant for the usual ZIP compression method. This requires " "the :mod:`zlib` module." msgstr "" -#: ../../library/zipfile.rst:103 +#: ../../library/zipfile.rst:104 msgid "" "The numeric constant for the BZIP2 compression method. This requires the :" "mod:`bz2` module." msgstr "" -#: ../../library/zipfile.rst:110 +#: ../../library/zipfile.rst:111 msgid "" "The numeric constant for the LZMA compression method. This requires the :" "mod:`lzma` module." msgstr "" -#: ../../library/zipfile.rst:117 +#: ../../library/zipfile.rst:118 msgid "" "The ZIP file format specification has included support for bzip2 compression " "since 2001, and for LZMA compression since 2006. However, some tools " @@ -132,37 +133,37 @@ msgid "" "individual files." msgstr "" -#: ../../library/zipfile.rst:128 +#: ../../library/zipfile.rst:129 msgid "`PKZIP Application Note`_" msgstr "" -#: ../../library/zipfile.rst:127 +#: ../../library/zipfile.rst:128 msgid "" "Documentation on the ZIP file format by Phil Katz, the creator of the format " "and algorithms used." msgstr "" -#: ../../library/zipfile.rst:131 +#: ../../library/zipfile.rst:132 msgid "`Info-ZIP Home Page `_" msgstr "`Info-ZIP 首頁 `_" -#: ../../library/zipfile.rst:131 +#: ../../library/zipfile.rst:132 msgid "" "Information about the Info-ZIP project's ZIP archive programs and " "development libraries." msgstr "" -#: ../../library/zipfile.rst:138 +#: ../../library/zipfile.rst:139 msgid "ZipFile Objects" msgstr "ZipFile 物件" -#: ../../library/zipfile.rst:145 +#: ../../library/zipfile.rst:146 msgid "" "Open a ZIP file, where *file* can be a path to a file (a string), a file-" "like object or a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:148 +#: ../../library/zipfile.rst:149 msgid "" "The *mode* parameter should be ``'r'`` to read an existing file, ``'w'`` to " "truncate and write a new file, ``'a'`` to append to an existing file, or " @@ -176,7 +177,7 @@ msgid "" "``'r'`` or ``'a'``, the file should be seekable." msgstr "" -#: ../../library/zipfile.rst:160 +#: ../../library/zipfile.rst:161 msgid "" "*compression* is the ZIP compression method to use when writing the archive, " "and should be :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:`ZIP_BZIP2` " @@ -187,7 +188,7 @@ msgid "" "is raised. The default is :const:`ZIP_STORED`." msgstr "" -#: ../../library/zipfile.rst:168 +#: ../../library/zipfile.rst:169 msgid "" "If *allowZip64* is ``True`` (the default) zipfile will create ZIP files that " "use the ZIP64 extensions when the zipfile is larger than 4 GiB. If it is " @@ -195,7 +196,7 @@ msgid "" "require ZIP64 extensions." msgstr "" -#: ../../library/zipfile.rst:173 +#: ../../library/zipfile.rst:174 msgid "" "The *compresslevel* parameter controls the compression level to use when " "writing files to the archive. When using :const:`ZIP_STORED` or :const:" @@ -205,7 +206,7 @@ msgid "" "accepted (see :class:`bz2 ` for more information)." msgstr "" -#: ../../library/zipfile.rst:181 ../../library/zipfile.rst:733 +#: ../../library/zipfile.rst:182 ../../library/zipfile.rst:734 msgid "" "The *strict_timestamps* argument, when set to ``False``, allows to zip files " "older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. " @@ -213,34 +214,34 @@ msgid "" "also set to the limit." msgstr "" -#: ../../library/zipfile.rst:187 +#: ../../library/zipfile.rst:188 msgid "" "When mode is ``'r'``, *metadata_encoding* may be set to the name of a codec, " "which will be used to decode metadata such as the names of members and ZIP " "comments." msgstr "" -#: ../../library/zipfile.rst:191 +#: ../../library/zipfile.rst:192 msgid "" "If the file is created with mode ``'w'``, ``'x'`` or ``'a'`` and then :meth:" "`closed ` without adding any files to the archive, the appropriate " "ZIP structures for an empty archive will be written to the file." msgstr "" -#: ../../library/zipfile.rst:195 +#: ../../library/zipfile.rst:196 msgid "" "ZipFile is also a context manager and therefore supports the :keyword:`with` " "statement. In the example, *myzip* is closed after the :keyword:`!with` " "statement's suite is finished---even if an exception occurs::" msgstr "" -#: ../../library/zipfile.rst:204 +#: ../../library/zipfile.rst:205 msgid "" "*metadata_encoding* is an instance-wide setting for the ZipFile. It is not " "currently possible to set this on a per-member basis." msgstr "" -#: ../../library/zipfile.rst:207 +#: ../../library/zipfile.rst:208 msgid "" "This attribute is a workaround for legacy implementations which produce " "archives with names in the current locale encoding or code page (mostly on " @@ -250,73 +251,73 @@ msgid "" "is a Python-specific extension." msgstr "" -#: ../../library/zipfile.rst:215 +#: ../../library/zipfile.rst:216 msgid "Added the ability to use :class:`ZipFile` as a context manager." msgstr "" -#: ../../library/zipfile.rst:218 +#: ../../library/zipfile.rst:219 msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." msgstr "" -#: ../../library/zipfile.rst:221 ../../library/zipfile.rst:647 +#: ../../library/zipfile.rst:222 ../../library/zipfile.rst:648 msgid "ZIP64 extensions are enabled by default." msgstr "" -#: ../../library/zipfile.rst:224 +#: ../../library/zipfile.rst:225 msgid "" "Added support for writing to unseekable streams. Added support for the " "``'x'`` mode." msgstr "" -#: ../../library/zipfile.rst:228 +#: ../../library/zipfile.rst:229 msgid "" "Previously, a plain :exc:`RuntimeError` was raised for unrecognized " "compression values." msgstr "" -#: ../../library/zipfile.rst:232 +#: ../../library/zipfile.rst:233 msgid "The *file* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:235 +#: ../../library/zipfile.rst:236 msgid "Add the *compresslevel* parameter." msgstr "" -#: ../../library/zipfile.rst:238 ../../library/zipfile.rst:744 +#: ../../library/zipfile.rst:239 ../../library/zipfile.rst:745 msgid "The *strict_timestamps* keyword-only argument" msgstr "" -#: ../../library/zipfile.rst:241 +#: ../../library/zipfile.rst:242 msgid "" "Added support for specifying member name encoding for reading metadata in " "the zipfile's directory and file headers." msgstr "" -#: ../../library/zipfile.rst:248 +#: ../../library/zipfile.rst:249 msgid "" "Close the archive file. You must call :meth:`close` before exiting your " "program or essential records will not be written." msgstr "" -#: ../../library/zipfile.rst:254 +#: ../../library/zipfile.rst:255 msgid "" "Return a :class:`ZipInfo` object with information about the archive member " "*name*. Calling :meth:`getinfo` for a name not currently contained in the " "archive will raise a :exc:`KeyError`." msgstr "" -#: ../../library/zipfile.rst:261 +#: ../../library/zipfile.rst:262 msgid "" "Return a list containing a :class:`ZipInfo` object for each member of the " "archive. The objects are in the same order as their entries in the actual " "ZIP file on disk if an existing archive was opened." msgstr "" -#: ../../library/zipfile.rst:268 +#: ../../library/zipfile.rst:269 msgid "Return a list of archive members by name." msgstr "" -#: ../../library/zipfile.rst:273 +#: ../../library/zipfile.rst:274 msgid "" "Access a member of the archive as a binary file-like object. *name* can be " "either the name of a file within the archive or a :class:`ZipInfo` object. " @@ -325,13 +326,13 @@ msgid "" "class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:279 +#: ../../library/zipfile.rst:280 msgid "" ":meth:`~ZipFile.open` is also a context manager and therefore supports the :" "keyword:`with` statement::" msgstr "" -#: ../../library/zipfile.rst:286 +#: ../../library/zipfile.rst:287 msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " "provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." @@ -340,7 +341,7 @@ msgid "" "objects can operate independently of the ZipFile." msgstr "" -#: ../../library/zipfile.rst:293 +#: ../../library/zipfile.rst:294 msgid "" "With ``mode='w'``, a writable file handle is returned, which supports the :" "meth:`~io.BufferedIOBase.write` method. While a writable file handle is " @@ -348,7 +349,7 @@ msgid "" "exc:`ValueError`." msgstr "" -#: ../../library/zipfile.rst:298 +#: ../../library/zipfile.rst:299 msgid "" "When writing a file, if the file size is not known in advance but may exceed " "2 GiB, pass ``force_zip64=True`` to ensure that the header format is capable " @@ -357,32 +358,32 @@ msgid "" "as the *name* parameter." msgstr "" -#: ../../library/zipfile.rst:306 +#: ../../library/zipfile.rst:307 msgid "" "The :meth:`.open`, :meth:`read` and :meth:`extract` methods can take a " "filename or a :class:`ZipInfo` object. You will appreciate this when trying " "to read a ZIP file that contains members with duplicate names." msgstr "" -#: ../../library/zipfile.rst:310 +#: ../../library/zipfile.rst:311 msgid "" "Removed support of ``mode='U'``. Use :class:`io.TextIOWrapper` for reading " "compressed text files in :term:`universal newlines` mode." msgstr "" -#: ../../library/zipfile.rst:314 +#: ../../library/zipfile.rst:315 msgid "" ":meth:`ZipFile.open` can now be used to write files into the archive with " "the ``mode='w'`` option." msgstr "" -#: ../../library/zipfile.rst:318 +#: ../../library/zipfile.rst:319 msgid "" "Calling :meth:`.open` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:325 +#: ../../library/zipfile.rst:326 msgid "" "Extract a member from the archive to the current working directory; *member* " "must be its full name or a :class:`ZipInfo` object. Its file information is " @@ -391,11 +392,11 @@ msgid "" "*pwd* is the password used for encrypted files as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:331 +#: ../../library/zipfile.rst:332 msgid "Returns the normalized path created (a directory or new file)." msgstr "" -#: ../../library/zipfile.rst:335 +#: ../../library/zipfile.rst:336 msgid "" "If a member filename is an absolute path, a drive/UNC sharepoint and leading " "(back)slashes will be stripped, e.g.: ``///foo/bar`` becomes ``foo/bar`` on " @@ -406,17 +407,17 @@ msgid "" "(``_``)." msgstr "" -#: ../../library/zipfile.rst:343 +#: ../../library/zipfile.rst:344 msgid "" "Calling :meth:`extract` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:347 ../../library/zipfile.rst:370 +#: ../../library/zipfile.rst:348 ../../library/zipfile.rst:371 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:353 +#: ../../library/zipfile.rst:354 msgid "" "Extract all members from the archive to the current working directory. " "*path* specifies a different directory to extract to. *members* is optional " @@ -424,7 +425,7 @@ msgid "" "password used for encrypted files as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:360 +#: ../../library/zipfile.rst:361 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -432,23 +433,23 @@ msgid "" "\"``. This module attempts to prevent that. See :meth:`extract` note." msgstr "" -#: ../../library/zipfile.rst:366 +#: ../../library/zipfile.rst:367 msgid "" "Calling :meth:`extractall` on a closed ZipFile will raise a :exc:" "`ValueError`. Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:376 +#: ../../library/zipfile.rst:377 msgid "Print a table of contents for the archive to ``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:381 +#: ../../library/zipfile.rst:382 msgid "" "Set *pwd* (a :class:`bytes` object) as default password to extract encrypted " "files." msgstr "" -#: ../../library/zipfile.rst:386 +#: ../../library/zipfile.rst:387 msgid "" "Return the bytes of the file *name* in the archive. *name* is the name of " "the file in the archive, or a :class:`ZipInfo` object. The archive must be " @@ -461,25 +462,25 @@ msgid "" "compression module is not available." msgstr "" -#: ../../library/zipfile.rst:395 +#: ../../library/zipfile.rst:396 msgid "" "Calling :meth:`read` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:402 +#: ../../library/zipfile.rst:403 msgid "" "Read all the files in the archive and check their CRC's and file headers. " "Return the name of the first bad file, or else return ``None``." msgstr "" -#: ../../library/zipfile.rst:405 +#: ../../library/zipfile.rst:406 msgid "" "Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:413 +#: ../../library/zipfile.rst:414 msgid "" "Write the file named *filename* to the archive, giving it the archive name " "*arcname* (by default, this will be the same as *filename*, but without a " @@ -490,7 +491,7 @@ msgid "" "``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:423 +#: ../../library/zipfile.rst:424 msgid "" "The ZIP file standard historically did not specify a metadata encoding, but " "strongly recommended CP437 (the original IBM PC encoding) for " @@ -500,33 +501,33 @@ msgid "" "in any encoding other than ASCII or UTF-8." msgstr "" -#: ../../library/zipfile.rst:432 +#: ../../library/zipfile.rst:433 msgid "" "Archive names should be relative to the archive root, that is, they should " "not start with a path separator." msgstr "" -#: ../../library/zipfile.rst:437 +#: ../../library/zipfile.rst:438 msgid "" "If ``arcname`` (or ``filename``, if ``arcname`` is not given) contains a " "null byte, the name of the file in the archive will be truncated at the null " "byte." msgstr "" -#: ../../library/zipfile.rst:442 +#: ../../library/zipfile.rst:443 msgid "" "A leading slash in the filename may lead to the archive being impossible to " "open in some zip programs on Windows systems." msgstr "" -#: ../../library/zipfile.rst:445 +#: ../../library/zipfile.rst:446 msgid "" "Calling :meth:`write` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:454 +#: ../../library/zipfile.rst:455 msgid "" "Write a file into the archive. The contents is *data*, which may be either " "a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, it is " @@ -537,7 +538,7 @@ msgid "" "must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:462 +#: ../../library/zipfile.rst:463 msgid "" "If given, *compress_type* overrides the value given for the *compression* " "parameter to the constructor for the new entry, or in the *zinfo_or_arcname* " @@ -545,7 +546,7 @@ msgid "" "override the constructor if given." msgstr "" -#: ../../library/zipfile.rst:469 +#: ../../library/zipfile.rst:470 msgid "" "When passing a :class:`ZipInfo` instance as the *zinfo_or_arcname* " "parameter, the compression method used will be that specified in the " @@ -553,18 +554,18 @@ msgid "" "the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`." msgstr "" -#: ../../library/zipfile.rst:474 +#: ../../library/zipfile.rst:475 msgid "The *compress_type* argument." msgstr "*compress_type* 引數。" -#: ../../library/zipfile.rst:477 +#: ../../library/zipfile.rst:478 msgid "" "Calling :meth:`writestr` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:484 +#: ../../library/zipfile.rst:485 msgid "" "Create a directory inside the archive. If *zinfo_or_directory* is a string, " "a directory is created inside the archive with the mode that is specified in " @@ -572,26 +573,26 @@ msgid "" "instance then the *mode* argument is ignored." msgstr "" -#: ../../library/zipfile.rst:489 +#: ../../library/zipfile.rst:490 msgid "The archive must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:494 +#: ../../library/zipfile.rst:495 msgid "The following data attributes are also available:" msgstr "" -#: ../../library/zipfile.rst:498 +#: ../../library/zipfile.rst:499 msgid "Name of the ZIP file." msgstr "" -#: ../../library/zipfile.rst:502 +#: ../../library/zipfile.rst:503 msgid "" "The level of debug output to use. This may be set from ``0`` (the default, " "no output) to ``3`` (the most output). Debugging information is written to " "``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:508 +#: ../../library/zipfile.rst:509 msgid "" "The comment associated with the ZIP file as a :class:`bytes` object. If " "assigning a comment to a :class:`ZipFile` instance created with mode " @@ -599,37 +600,37 @@ msgid "" "Comments longer than this will be truncated." msgstr "" -#: ../../library/zipfile.rst:518 +#: ../../library/zipfile.rst:519 msgid "Path Objects" msgstr "" -#: ../../library/zipfile.rst:522 +#: ../../library/zipfile.rst:523 msgid "" "Construct a Path object from a ``root`` zipfile (which may be a :class:" "`ZipFile` instance or ``file`` suitable for passing to the :class:`ZipFile` " "constructor)." msgstr "" -#: ../../library/zipfile.rst:526 +#: ../../library/zipfile.rst:527 msgid "" "``at`` specifies the location of this Path within the zipfile, e.g. 'dir/" "file.txt', 'dir/', or ''. Defaults to the empty string, indicating the root." msgstr "" -#: ../../library/zipfile.rst:530 +#: ../../library/zipfile.rst:531 msgid "" "Path objects expose the following features of :mod:`pathlib.Path` objects:" msgstr "" -#: ../../library/zipfile.rst:533 +#: ../../library/zipfile.rst:534 msgid "Path objects are traversable using the ``/`` operator or ``joinpath``." msgstr "" -#: ../../library/zipfile.rst:537 +#: ../../library/zipfile.rst:538 msgid "The final path component." msgstr "" -#: ../../library/zipfile.rst:541 +#: ../../library/zipfile.rst:542 msgid "" "Invoke :meth:`ZipFile.open` on the current path. Allows opening for read or " "write, text or binary through supported modes: 'r', 'w', 'rb', 'wb'. " @@ -638,12 +639,12 @@ msgid "" "``pwd`` parameter to :meth:`ZipFile.open`." msgstr "" -#: ../../library/zipfile.rst:550 +#: ../../library/zipfile.rst:551 msgid "" "Added support for text and binary modes for open. Default mode is now text." msgstr "" -#: ../../library/zipfile.rst:554 ../../library/zipfile.rst:605 +#: ../../library/zipfile.rst:555 ../../library/zipfile.rst:606 msgid "" "The ``encoding`` parameter can be supplied as a positional argument without " "causing a :exc:`TypeError`. As it could in 3.9. Code needing to be " @@ -651,117 +652,117 @@ msgid "" "TextIOWrapper` arguments, ``encoding`` included, as keywords." msgstr "" -#: ../../library/zipfile.rst:562 +#: ../../library/zipfile.rst:563 msgid "Enumerate the children of the current directory." msgstr "" -#: ../../library/zipfile.rst:566 +#: ../../library/zipfile.rst:567 msgid "Return ``True`` if the current context references a directory." msgstr "" -#: ../../library/zipfile.rst:570 +#: ../../library/zipfile.rst:571 msgid "Return ``True`` if the current context references a file." msgstr "" -#: ../../library/zipfile.rst:574 +#: ../../library/zipfile.rst:575 msgid "" "Return ``True`` if the current context references a file or directory in the " "zip file." msgstr "" -#: ../../library/zipfile.rst:579 +#: ../../library/zipfile.rst:580 msgid "The file extension of the final component." msgstr "" -#: ../../library/zipfile.rst:581 +#: ../../library/zipfile.rst:582 msgid "Added :data:`Path.suffix` property." msgstr "" -#: ../../library/zipfile.rst:586 +#: ../../library/zipfile.rst:587 msgid "The final path component, without its suffix." msgstr "" -#: ../../library/zipfile.rst:588 +#: ../../library/zipfile.rst:589 msgid "Added :data:`Path.stem` property." msgstr "" -#: ../../library/zipfile.rst:593 +#: ../../library/zipfile.rst:594 msgid "A list of the path’s file extensions." msgstr "" -#: ../../library/zipfile.rst:595 +#: ../../library/zipfile.rst:596 msgid "Added :data:`Path.suffixes` property." msgstr "" -#: ../../library/zipfile.rst:600 +#: ../../library/zipfile.rst:601 msgid "" "Read the current file as unicode text. Positional and keyword arguments are " "passed through to :class:`io.TextIOWrapper` (except ``buffer``, which is " "implied by the context)." msgstr "" -#: ../../library/zipfile.rst:613 +#: ../../library/zipfile.rst:614 msgid "Read the current file as bytes." msgstr "" -#: ../../library/zipfile.rst:617 +#: ../../library/zipfile.rst:618 msgid "" "Return a new Path object with each of the *other* arguments joined. The " "following are equivalent::" msgstr "" -#: ../../library/zipfile.rst:624 +#: ../../library/zipfile.rst:625 msgid "" "Prior to 3.10, ``joinpath`` was undocumented and accepted exactly one " "parameter." msgstr "" -#: ../../library/zipfile.rst:628 +#: ../../library/zipfile.rst:629 msgid "" "The `zipp `_ project provides backports of " "the latest path object functionality to older Pythons. Use ``zipp.Path`` in " "place of ``zipfile.Path`` for early access to changes." msgstr "" -#: ../../library/zipfile.rst:636 +#: ../../library/zipfile.rst:637 msgid "PyZipFile Objects" msgstr "PyZipFile 物件" -#: ../../library/zipfile.rst:638 +#: ../../library/zipfile.rst:639 msgid "" "The :class:`PyZipFile` constructor takes the same parameters as the :class:" "`ZipFile` constructor, and one additional parameter, *optimize*." msgstr "" -#: ../../library/zipfile.rst:644 +#: ../../library/zipfile.rst:645 msgid "The *optimize* parameter." msgstr "*optimize* 參數。" -#: ../../library/zipfile.rst:650 +#: ../../library/zipfile.rst:651 msgid "" "Instances have one method in addition to those of :class:`ZipFile` objects:" msgstr "" -#: ../../library/zipfile.rst:654 +#: ../../library/zipfile.rst:655 msgid "" "Search for files :file:`\\*.py` and add the corresponding file to the " "archive." msgstr "" -#: ../../library/zipfile.rst:657 +#: ../../library/zipfile.rst:658 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``, " "the corresponding file is a :file:`\\*.pyc` file, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:660 +#: ../../library/zipfile.rst:661 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or ``2``, " "only files with that optimization level (see :func:`compile`) are added to " "the archive, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:664 +#: ../../library/zipfile.rst:665 msgid "" "If *pathname* is a file, the filename must end with :file:`.py`, and just " "the (corresponding :file:`\\*.pyc`) file is added at the top level (no path " @@ -774,11 +775,11 @@ msgid "" "in sorted order." msgstr "" -#: ../../library/zipfile.rst:674 +#: ../../library/zipfile.rst:675 msgid "*basename* is intended for internal use only." msgstr "" -#: ../../library/zipfile.rst:676 +#: ../../library/zipfile.rst:677 msgid "" "*filterfunc*, if given, must be a function taking a single string argument. " "It will be passed each path (including each individual full file path) " @@ -789,286 +790,286 @@ msgid "" "exclude them::" msgstr "" -#: ../../library/zipfile.rst:690 +#: ../../library/zipfile.rst:691 msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr "" -#: ../../library/zipfile.rst:699 +#: ../../library/zipfile.rst:700 msgid "The *filterfunc* parameter." msgstr "*filterfunc* 參數。" -#: ../../library/zipfile.rst:702 +#: ../../library/zipfile.rst:703 msgid "The *pathname* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:705 +#: ../../library/zipfile.rst:706 msgid "Recursion sorts directory entries." msgstr "" -#: ../../library/zipfile.rst:712 +#: ../../library/zipfile.rst:713 msgid "ZipInfo Objects" msgstr "ZipInfo 物件" -#: ../../library/zipfile.rst:714 +#: ../../library/zipfile.rst:715 msgid "" "Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` " "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " "stores information about a single member of the ZIP archive." msgstr "" -#: ../../library/zipfile.rst:718 +#: ../../library/zipfile.rst:719 msgid "" "There is one classmethod to make a :class:`ZipInfo` instance for a " "filesystem file:" msgstr "" -#: ../../library/zipfile.rst:724 +#: ../../library/zipfile.rst:725 msgid "" "Construct a :class:`ZipInfo` instance for a file on the filesystem, in " "preparation for adding it to a zip file." msgstr "" -#: ../../library/zipfile.rst:727 +#: ../../library/zipfile.rst:728 msgid "*filename* should be the path to a file or directory on the filesystem." msgstr "" -#: ../../library/zipfile.rst:729 +#: ../../library/zipfile.rst:730 msgid "" "If *arcname* is specified, it is used as the name within the archive. If " "*arcname* is not specified, the name will be the same as *filename*, but " "with any drive letter and leading path separators removed." msgstr "" -#: ../../library/zipfile.rst:741 +#: ../../library/zipfile.rst:742 msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:748 +#: ../../library/zipfile.rst:749 msgid "Instances have the following methods and attributes:" msgstr "" -#: ../../library/zipfile.rst:752 +#: ../../library/zipfile.rst:753 msgid "Return ``True`` if this archive member is a directory." msgstr "" -#: ../../library/zipfile.rst:754 +#: ../../library/zipfile.rst:755 msgid "This uses the entry's name: directories should always end with ``/``." msgstr "" -#: ../../library/zipfile.rst:761 +#: ../../library/zipfile.rst:762 msgid "Name of the file in the archive." msgstr "" -#: ../../library/zipfile.rst:766 +#: ../../library/zipfile.rst:767 msgid "" "The time and date of the last modification to the archive member. This is a " "tuple of six values:" msgstr "" -#: ../../library/zipfile.rst:770 +#: ../../library/zipfile.rst:771 msgid "Index" msgstr "" -#: ../../library/zipfile.rst:770 +#: ../../library/zipfile.rst:771 msgid "Value" msgstr "" -#: ../../library/zipfile.rst:772 +#: ../../library/zipfile.rst:773 msgid "``0``" msgstr "``0``" -#: ../../library/zipfile.rst:772 +#: ../../library/zipfile.rst:773 msgid "Year (>= 1980)" msgstr "" -#: ../../library/zipfile.rst:774 +#: ../../library/zipfile.rst:775 msgid "``1``" msgstr "``1``" -#: ../../library/zipfile.rst:774 +#: ../../library/zipfile.rst:775 msgid "Month (one-based)" msgstr "" -#: ../../library/zipfile.rst:776 +#: ../../library/zipfile.rst:777 msgid "``2``" msgstr "``2``" -#: ../../library/zipfile.rst:776 +#: ../../library/zipfile.rst:777 msgid "Day of month (one-based)" msgstr "" -#: ../../library/zipfile.rst:778 +#: ../../library/zipfile.rst:779 msgid "``3``" msgstr "``3``" -#: ../../library/zipfile.rst:778 +#: ../../library/zipfile.rst:779 msgid "Hours (zero-based)" msgstr "" -#: ../../library/zipfile.rst:780 +#: ../../library/zipfile.rst:781 msgid "``4``" msgstr "``4``" -#: ../../library/zipfile.rst:780 +#: ../../library/zipfile.rst:781 msgid "Minutes (zero-based)" msgstr "" -#: ../../library/zipfile.rst:782 +#: ../../library/zipfile.rst:783 msgid "``5``" msgstr "``5``" -#: ../../library/zipfile.rst:782 +#: ../../library/zipfile.rst:783 msgid "Seconds (zero-based)" msgstr "" -#: ../../library/zipfile.rst:787 +#: ../../library/zipfile.rst:788 msgid "The ZIP file format does not support timestamps before 1980." msgstr "" -#: ../../library/zipfile.rst:792 +#: ../../library/zipfile.rst:793 msgid "Type of compression for the archive member." msgstr "" -#: ../../library/zipfile.rst:797 +#: ../../library/zipfile.rst:798 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:802 +#: ../../library/zipfile.rst:803 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " "object." msgstr "" -#: ../../library/zipfile.rst:809 +#: ../../library/zipfile.rst:810 msgid "System which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:814 +#: ../../library/zipfile.rst:815 msgid "PKZIP version which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:819 +#: ../../library/zipfile.rst:820 msgid "PKZIP version needed to extract archive." msgstr "" -#: ../../library/zipfile.rst:824 +#: ../../library/zipfile.rst:825 msgid "Must be zero." msgstr "" -#: ../../library/zipfile.rst:829 +#: ../../library/zipfile.rst:830 msgid "ZIP flag bits." msgstr "" -#: ../../library/zipfile.rst:834 +#: ../../library/zipfile.rst:835 msgid "Volume number of file header." msgstr "" -#: ../../library/zipfile.rst:839 +#: ../../library/zipfile.rst:840 msgid "Internal attributes." msgstr "" -#: ../../library/zipfile.rst:844 +#: ../../library/zipfile.rst:845 msgid "External file attributes." msgstr "" -#: ../../library/zipfile.rst:849 +#: ../../library/zipfile.rst:850 msgid "Byte offset to the file header." msgstr "" -#: ../../library/zipfile.rst:854 +#: ../../library/zipfile.rst:855 msgid "CRC-32 of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:859 +#: ../../library/zipfile.rst:860 msgid "Size of the compressed data." msgstr "" -#: ../../library/zipfile.rst:864 +#: ../../library/zipfile.rst:865 msgid "Size of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:871 +#: ../../library/zipfile.rst:872 msgid "Command-Line Interface" msgstr "" -#: ../../library/zipfile.rst:873 +#: ../../library/zipfile.rst:874 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" -#: ../../library/zipfile.rst:876 +#: ../../library/zipfile.rst:877 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/zipfile.rst:883 +#: ../../library/zipfile.rst:884 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/zipfile.rst:889 +#: ../../library/zipfile.rst:890 msgid "" "If you want to extract a ZIP archive into the specified directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/zipfile.rst:896 +#: ../../library/zipfile.rst:897 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "" -#: ../../library/zipfile.rst:904 +#: ../../library/zipfile.rst:905 msgid "Command-line options" msgstr "" -#: ../../library/zipfile.rst:909 +#: ../../library/zipfile.rst:910 msgid "List files in a zipfile." msgstr "" -#: ../../library/zipfile.rst:914 +#: ../../library/zipfile.rst:915 msgid "Create zipfile from source files." msgstr "" -#: ../../library/zipfile.rst:919 +#: ../../library/zipfile.rst:920 msgid "Extract zipfile into target directory." msgstr "" -#: ../../library/zipfile.rst:924 +#: ../../library/zipfile.rst:925 msgid "Test whether the zipfile is valid or not." msgstr "" -#: ../../library/zipfile.rst:928 +#: ../../library/zipfile.rst:929 msgid "" "Specify encoding of member names for :option:`-l`, :option:`-e` and :option:" "`-t`." msgstr "" -#: ../../library/zipfile.rst:935 +#: ../../library/zipfile.rst:936 msgid "Decompression pitfalls" msgstr "" -#: ../../library/zipfile.rst:937 +#: ../../library/zipfile.rst:938 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "" -#: ../../library/zipfile.rst:940 +#: ../../library/zipfile.rst:941 msgid "From file itself" msgstr "" -#: ../../library/zipfile.rst:942 +#: ../../library/zipfile.rst:943 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." msgstr "" -#: ../../library/zipfile.rst:946 +#: ../../library/zipfile.rst:947 msgid "File System limitations" msgstr "" -#: ../../library/zipfile.rst:948 +#: ../../library/zipfile.rst:949 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -1076,33 +1077,33 @@ msgid "" "files, etc." msgstr "" -#: ../../library/zipfile.rst:955 +#: ../../library/zipfile.rst:956 msgid "Resources limitations" msgstr "" -#: ../../library/zipfile.rst:957 +#: ../../library/zipfile.rst:958 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " "can cause disk volume exhaustion." msgstr "" -#: ../../library/zipfile.rst:962 +#: ../../library/zipfile.rst:963 msgid "Interruption" msgstr "" -#: ../../library/zipfile.rst:964 +#: ../../library/zipfile.rst:965 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " "archive." msgstr "" -#: ../../library/zipfile.rst:968 +#: ../../library/zipfile.rst:969 msgid "Default behaviors of extraction" msgstr "" -#: ../../library/zipfile.rst:970 +#: ../../library/zipfile.rst:971 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index d5c8d46ea6..7d7fade05d 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-05 00:16+0000\n" +"POT-Creation-Date: 2023-02-22 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -263,20 +263,18 @@ msgstr "" #: ../../reference/compound_stmts.rst:303 msgid "" -"Before an :keyword:`!except` clause's suite is executed, details about the " -"exception are stored in the :mod:`sys` module and can be accessed via :func:" -"`sys.exc_info`. :func:`sys.exc_info` returns a 3-tuple consisting of the " -"exception class, the exception instance and a traceback object (see section :" -"ref:`types`) identifying the point in the program where the exception " -"occurred. The details about the exception accessed via :func:`sys.exc_info` " -"are restored to their previous values when leaving an exception handler::" +"Before an :keyword:`!except` clause's suite is executed, the exception is " +"stored in the :mod:`sys` module, where it can be accessed from within the " +"body of the :keyword:`!except` clause by calling :func:`sys.exception`. When " +"leaving an exception handler, the exception stored in the :mod:`sys` module " +"is reset to its previous value::" msgstr "" -#: ../../reference/compound_stmts.rst:337 +#: ../../reference/compound_stmts.rst:334 msgid ":keyword:`!except*` clause" msgstr "" -#: ../../reference/compound_stmts.rst:339 +#: ../../reference/compound_stmts.rst:336 msgid "" "The :keyword:`!except*` clause(s) are used for handling :exc:" "`ExceptionGroup`\\s. The exception type for matching is interpreted as in " @@ -289,21 +287,21 @@ msgid "" "that matches it. ::" msgstr "" -#: ../../reference/compound_stmts.rst:367 +#: ../../reference/compound_stmts.rst:364 msgid "" "Any remaining exceptions that were not handled by any :keyword:`!except*` " "clause are re-raised at the end, combined into an exception group along with " "all exceptions that were raised from within :keyword:`!except*` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:371 +#: ../../reference/compound_stmts.rst:368 msgid "" "If the raised exception is not an exception group and its type matches one " "of the :keyword:`!except*` clauses, it is caught and wrapped by an exception " "group with an empty message string. ::" msgstr "" -#: ../../reference/compound_stmts.rst:382 +#: ../../reference/compound_stmts.rst:379 msgid "" "An :keyword:`!except*` clause must have a matching type, and this type " "cannot be a subclass of :exc:`BaseExceptionGroup`. It is not possible to " @@ -312,11 +310,11 @@ msgid "" "an :keyword:`!except*` clause." msgstr "" -#: ../../reference/compound_stmts.rst:399 +#: ../../reference/compound_stmts.rst:396 msgid ":keyword:`!else` clause" msgstr "" -#: ../../reference/compound_stmts.rst:401 +#: ../../reference/compound_stmts.rst:398 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " "the :keyword:`try` suite, no exception was raised, and no :keyword:" @@ -325,11 +323,11 @@ msgid "" "keyword:`except` clauses." msgstr "" -#: ../../reference/compound_stmts.rst:413 +#: ../../reference/compound_stmts.rst:410 msgid ":keyword:`!finally` clause" msgstr "" -#: ../../reference/compound_stmts.rst:415 +#: ../../reference/compound_stmts.rst:412 msgid "" "If :keyword:`!finally` is present, it specifies a 'cleanup' handler. The :" "keyword:`try` clause is executed, including any :keyword:`except` and :" @@ -343,13 +341,13 @@ msgid "" "exception is discarded::" msgstr "" -#: ../../reference/compound_stmts.rst:434 +#: ../../reference/compound_stmts.rst:431 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`!finally` clause." msgstr "" -#: ../../reference/compound_stmts.rst:442 +#: ../../reference/compound_stmts.rst:439 msgid "" "When a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " "is executed in the :keyword:`try` suite of a :keyword:`!try`...\\ :keyword:`!" @@ -357,7 +355,7 @@ msgid "" "way out.'" msgstr "" -#: ../../reference/compound_stmts.rst:446 +#: ../../reference/compound_stmts.rst:443 msgid "" "The return value of a function is determined by the last :keyword:`return` " "statement executed. Since the :keyword:`!finally` clause always executes, " @@ -365,17 +363,17 @@ msgid "" "will always be the last one executed::" msgstr "" -#: ../../reference/compound_stmts.rst:460 +#: ../../reference/compound_stmts.rst:457 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`!finally` clause due to a problem with the implementation." msgstr "" -#: ../../reference/compound_stmts.rst:469 +#: ../../reference/compound_stmts.rst:466 msgid "The :keyword:`!with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:478 +#: ../../reference/compound_stmts.rst:475 msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " @@ -383,37 +381,37 @@ msgid "" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" -#: ../../reference/compound_stmts.rst:488 +#: ../../reference/compound_stmts.rst:485 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" -#: ../../reference/compound_stmts.rst:490 +#: ../../reference/compound_stmts.rst:487 msgid "" "The context expression (the expression given in the :token:`~python-grammar:" "with_item`) is evaluated to obtain a context manager." msgstr "" -#: ../../reference/compound_stmts.rst:493 +#: ../../reference/compound_stmts.rst:490 msgid "The context manager's :meth:`__enter__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:495 +#: ../../reference/compound_stmts.rst:492 msgid "The context manager's :meth:`__exit__` is loaded for later use." msgstr "" -#: ../../reference/compound_stmts.rst:497 +#: ../../reference/compound_stmts.rst:494 msgid "The context manager's :meth:`__enter__` method is invoked." msgstr "" -#: ../../reference/compound_stmts.rst:499 +#: ../../reference/compound_stmts.rst:496 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`__enter__` is assigned to it." msgstr "" -#: ../../reference/compound_stmts.rst:504 +#: ../../reference/compound_stmts.rst:501 msgid "" "The :keyword:`with` statement guarantees that if the :meth:`__enter__` " "method returns without an error, then :meth:`__exit__` will always be " @@ -422,11 +420,11 @@ msgid "" "See step 7 below." msgstr "" -#: ../../reference/compound_stmts.rst:510 +#: ../../reference/compound_stmts.rst:507 msgid "The suite is executed." msgstr "" -#: ../../reference/compound_stmts.rst:512 +#: ../../reference/compound_stmts.rst:509 msgid "" "The context manager's :meth:`__exit__` method is invoked. If an exception " "caused the suite to be exited, its type, value, and traceback are passed as " @@ -434,7 +432,7 @@ msgid "" "supplied." msgstr "" -#: ../../reference/compound_stmts.rst:517 +#: ../../reference/compound_stmts.rst:514 msgid "" "If the suite was exited due to an exception, and the return value from the :" "meth:`__exit__` method was false, the exception is reraised. If the return " @@ -442,119 +440,119 @@ msgid "" "the statement following the :keyword:`with` statement." msgstr "" -#: ../../reference/compound_stmts.rst:522 +#: ../../reference/compound_stmts.rst:519 msgid "" "If the suite was exited for any reason other than an exception, the return " "value from :meth:`__exit__` is ignored, and execution proceeds at the normal " "location for the kind of exit that was taken." msgstr "" -#: ../../reference/compound_stmts.rst:526 -#: ../../reference/compound_stmts.rst:1517 -#: ../../reference/compound_stmts.rst:1558 +#: ../../reference/compound_stmts.rst:523 +#: ../../reference/compound_stmts.rst:1514 +#: ../../reference/compound_stmts.rst:1555 msgid "The following code::" msgstr "" -#: ../../reference/compound_stmts.rst:531 -#: ../../reference/compound_stmts.rst:556 -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:528 +#: ../../reference/compound_stmts.rst:553 +#: ../../reference/compound_stmts.rst:1560 msgid "is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:550 +#: ../../reference/compound_stmts.rst:547 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" -#: ../../reference/compound_stmts.rst:562 +#: ../../reference/compound_stmts.rst:559 msgid "" "You can also write multi-item context managers in multiple lines if the " "items are surrounded by parentheses. For example::" msgstr "" -#: ../../reference/compound_stmts.rst:571 +#: ../../reference/compound_stmts.rst:568 msgid "Support for multiple context expressions." msgstr "" -#: ../../reference/compound_stmts.rst:574 +#: ../../reference/compound_stmts.rst:571 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" -#: ../../reference/compound_stmts.rst:580 +#: ../../reference/compound_stmts.rst:577 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/compound_stmts.rst:580 +#: ../../reference/compound_stmts.rst:577 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/compound_stmts.rst:586 +#: ../../reference/compound_stmts.rst:583 msgid "The :keyword:`!match` statement" msgstr "" -#: ../../reference/compound_stmts.rst:600 +#: ../../reference/compound_stmts.rst:597 msgid "The match statement is used for pattern matching. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:609 +#: ../../reference/compound_stmts.rst:606 msgid "" "This section uses single quotes to denote :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:612 +#: ../../reference/compound_stmts.rst:609 msgid "" "Pattern matching takes a pattern as input (following ``case``) and a subject " "value (following ``match``). The pattern (which may contain subpatterns) is " "matched against the subject value. The outcomes are:" msgstr "" -#: ../../reference/compound_stmts.rst:616 +#: ../../reference/compound_stmts.rst:613 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" -#: ../../reference/compound_stmts.rst:618 +#: ../../reference/compound_stmts.rst:615 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" -#: ../../reference/compound_stmts.rst:621 +#: ../../reference/compound_stmts.rst:618 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords `." msgstr "" -#: ../../reference/compound_stmts.rst:625 -#: ../../reference/compound_stmts.rst:1180 +#: ../../reference/compound_stmts.rst:622 +#: ../../reference/compound_stmts.rst:1177 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../reference/compound_stmts.rst:626 -#: ../../reference/compound_stmts.rst:1181 +#: ../../reference/compound_stmts.rst:623 +#: ../../reference/compound_stmts.rst:1178 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" -#: ../../reference/compound_stmts.rst:630 +#: ../../reference/compound_stmts.rst:627 msgid "Overview" msgstr "" -#: ../../reference/compound_stmts.rst:632 +#: ../../reference/compound_stmts.rst:629 msgid "Here's an overview of the logical flow of a match statement:" msgstr "" -#: ../../reference/compound_stmts.rst:635 +#: ../../reference/compound_stmts.rst:632 msgid "" "The subject expression ``subject_expr`` is evaluated and a resulting subject " "value obtained. If the subject expression contains a comma, a tuple is " "constructed using :ref:`the standard rules `." msgstr "" -#: ../../reference/compound_stmts.rst:639 +#: ../../reference/compound_stmts.rst:636 msgid "" "Each pattern in a ``case_block`` is attempted to match with the subject " "value. The specific rules for success or failure are described below. The " @@ -564,7 +562,7 @@ msgid "" "outlive the executed block and can be used after the match statement**." msgstr "" -#: ../../reference/compound_stmts.rst:648 +#: ../../reference/compound_stmts.rst:645 msgid "" "During failed pattern matches, some subpatterns may succeed. Do not rely on " "bindings being made for a failed match. Conversely, do not rely on " @@ -573,87 +571,87 @@ msgid "" "made to allow different implementations to add optimizations." msgstr "" -#: ../../reference/compound_stmts.rst:655 +#: ../../reference/compound_stmts.rst:652 msgid "" "If the pattern succeeds, the corresponding guard (if present) is evaluated. " "In this case all name bindings are guaranteed to have happened." msgstr "" -#: ../../reference/compound_stmts.rst:658 +#: ../../reference/compound_stmts.rst:655 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" -#: ../../reference/compound_stmts.rst:661 +#: ../../reference/compound_stmts.rst:658 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" -#: ../../reference/compound_stmts.rst:663 +#: ../../reference/compound_stmts.rst:660 msgid "If there are no further case blocks, the match statement is completed." msgstr "" -#: ../../reference/compound_stmts.rst:667 +#: ../../reference/compound_stmts.rst:664 msgid "" "Users should generally never rely on a pattern being evaluated. Depending " "on implementation, the interpreter may cache values or use other " "optimizations which skip repeated evaluations." msgstr "" -#: ../../reference/compound_stmts.rst:671 +#: ../../reference/compound_stmts.rst:668 msgid "A sample match statement::" msgstr "" -#: ../../reference/compound_stmts.rst:687 +#: ../../reference/compound_stmts.rst:684 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" -#: ../../reference/compound_stmts.rst:690 +#: ../../reference/compound_stmts.rst:687 msgid "Guards" msgstr "" -#: ../../reference/compound_stmts.rst:697 +#: ../../reference/compound_stmts.rst:694 msgid "" "A ``guard`` (which is part of the ``case``) must succeed for code inside the " "``case`` block to execute. It takes the form: :keyword:`if` followed by an " "expression." msgstr "" -#: ../../reference/compound_stmts.rst:702 +#: ../../reference/compound_stmts.rst:699 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" msgstr "" -#: ../../reference/compound_stmts.rst:704 +#: ../../reference/compound_stmts.rst:701 msgid "" "Check that the pattern in the ``case`` block succeeded. If the pattern " "failed, the ``guard`` is not evaluated and the next ``case`` block is " "checked." msgstr "" -#: ../../reference/compound_stmts.rst:708 +#: ../../reference/compound_stmts.rst:705 msgid "If the pattern succeeded, evaluate the ``guard``." msgstr "" -#: ../../reference/compound_stmts.rst:710 +#: ../../reference/compound_stmts.rst:707 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:710 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" -#: ../../reference/compound_stmts.rst:716 +#: ../../reference/compound_stmts.rst:713 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:719 +#: ../../reference/compound_stmts.rst:716 msgid "" "Guards are allowed to have side effects as they are expressions. Guard " "evaluation must proceed from the first to the last case block, one at a " @@ -662,17 +660,17 @@ msgid "" "block is selected." msgstr "" -#: ../../reference/compound_stmts.rst:729 +#: ../../reference/compound_stmts.rst:726 msgid "Irrefutable Case Blocks" msgstr "" -#: ../../reference/compound_stmts.rst:733 +#: ../../reference/compound_stmts.rst:730 msgid "" "An irrefutable case block is a match-all case block. A match statement may " "have at most one irrefutable case block, and it must be last." msgstr "" -#: ../../reference/compound_stmts.rst:736 +#: ../../reference/compound_stmts.rst:733 msgid "" "A case block is considered irrefutable if it has no guard and its pattern is " "irrefutable. A pattern is considered irrefutable if we can prove from its " @@ -680,47 +678,47 @@ msgid "" "irrefutable:" msgstr "" -#: ../../reference/compound_stmts.rst:741 +#: ../../reference/compound_stmts.rst:738 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" msgstr "" -#: ../../reference/compound_stmts.rst:743 +#: ../../reference/compound_stmts.rst:740 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" msgstr "" -#: ../../reference/compound_stmts.rst:745 +#: ../../reference/compound_stmts.rst:742 msgid ":ref:`capture-patterns`" msgstr ":ref:`capture-patterns`" -#: ../../reference/compound_stmts.rst:747 +#: ../../reference/compound_stmts.rst:744 msgid ":ref:`wildcard-patterns`" msgstr ":ref:`wildcard-patterns`" -#: ../../reference/compound_stmts.rst:749 +#: ../../reference/compound_stmts.rst:746 msgid "parenthesized irrefutable patterns" msgstr "" -#: ../../reference/compound_stmts.rst:753 +#: ../../reference/compound_stmts.rst:750 msgid "Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:760 +#: ../../reference/compound_stmts.rst:757 msgid "This section uses grammar notations beyond standard EBNF:" msgstr "" -#: ../../reference/compound_stmts.rst:762 +#: ../../reference/compound_stmts.rst:759 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" msgstr "" -#: ../../reference/compound_stmts.rst:764 +#: ../../reference/compound_stmts.rst:761 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" -#: ../../reference/compound_stmts.rst:767 +#: ../../reference/compound_stmts.rst:764 msgid "The top-level syntax for ``patterns`` is:" msgstr "" -#: ../../reference/compound_stmts.rst:781 +#: ../../reference/compound_stmts.rst:778 msgid "" "The descriptions below will include a description \"in simple terms\" of " "what a pattern does for illustration purposes (credits to Raymond Hettinger " @@ -730,70 +728,70 @@ msgid "" "forms." msgstr "" -#: ../../reference/compound_stmts.rst:791 +#: ../../reference/compound_stmts.rst:788 msgid "OR Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:793 +#: ../../reference/compound_stmts.rst:790 msgid "" "An OR pattern is two or more patterns separated by vertical bars ``|``. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:799 +#: ../../reference/compound_stmts.rst:796 msgid "" "Only the final subpattern may be :ref:`irrefutable `, and " "each subpattern must bind the same set of names to avoid ambiguity." msgstr "" -#: ../../reference/compound_stmts.rst:802 +#: ../../reference/compound_stmts.rst:799 msgid "" "An OR pattern matches each of its subpatterns in turn to the subject value, " "until one succeeds. The OR pattern is then considered successful. " "Otherwise, if none of the subpatterns succeed, the OR pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:806 +#: ../../reference/compound_stmts.rst:803 msgid "" "In simple terms, ``P1 | P2 | ...`` will try to match ``P1``, if it fails it " "will try to match ``P2``, succeeding immediately if any succeeds, failing " "otherwise." msgstr "" -#: ../../reference/compound_stmts.rst:812 +#: ../../reference/compound_stmts.rst:809 msgid "AS Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:814 +#: ../../reference/compound_stmts.rst:811 msgid "" "An AS pattern matches an OR pattern on the left of the :keyword:`as` keyword " "against a subject. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:820 +#: ../../reference/compound_stmts.rst:817 msgid "" "If the OR pattern fails, the AS pattern fails. Otherwise, the AS pattern " "binds the subject to the name on the right of the as keyword and succeeds. " "``capture_pattern`` cannot be a a ``_``." msgstr "" -#: ../../reference/compound_stmts.rst:824 +#: ../../reference/compound_stmts.rst:821 msgid "" "In simple terms ``P as NAME`` will match with ``P``, and on success it will " "set ``NAME = ``." msgstr "" -#: ../../reference/compound_stmts.rst:831 +#: ../../reference/compound_stmts.rst:828 msgid "Literal Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:833 +#: ../../reference/compound_stmts.rst:830 msgid "" "A literal pattern corresponds to most :ref:`literals ` in Python. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:846 +#: ../../reference/compound_stmts.rst:843 msgid "" "The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" "`standard Python grammar <./grammar>`. Triple-quoted strings are " @@ -801,42 +799,42 @@ msgid "" "are not supported." msgstr "" -#: ../../reference/compound_stmts.rst:851 +#: ../../reference/compound_stmts.rst:848 msgid "" "The forms ``signed_number '+' NUMBER`` and ``signed_number '-' NUMBER`` are " "for expressing :ref:`complex numbers `; they require a real " "number on the left and an imaginary number on the right. E.g. ``3 + 4j``." msgstr "" -#: ../../reference/compound_stmts.rst:855 +#: ../../reference/compound_stmts.rst:852 msgid "" "In simple terms, ``LITERAL`` will succeed only if `` == LITERAL``. " "For the singletons ``None``, ``True`` and ``False``, the :keyword:`is` " "operator is used." msgstr "" -#: ../../reference/compound_stmts.rst:861 +#: ../../reference/compound_stmts.rst:858 msgid "Capture Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:863 +#: ../../reference/compound_stmts.rst:860 msgid "A capture pattern binds the subject value to a name. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:869 +#: ../../reference/compound_stmts.rst:866 msgid "" "A single underscore ``_`` is not a capture pattern (this is what ``!'_'`` " "expresses). It is instead treated as a :token:`~python-grammar:" "wildcard_pattern`." msgstr "" -#: ../../reference/compound_stmts.rst:873 +#: ../../reference/compound_stmts.rst:870 msgid "" "In a given pattern, a given name can only be bound once. E.g. ``case x, " "x: ...`` is invalid while ``case [x] | x: ...`` is allowed." msgstr "" -#: ../../reference/compound_stmts.rst:876 +#: ../../reference/compound_stmts.rst:873 msgid "" "Capture patterns always succeed. The binding follows scoping rules " "established by the assignment expression operator in :pep:`572`; the name " @@ -844,55 +842,55 @@ msgid "" "there's an applicable :keyword:`global` or :keyword:`nonlocal` statement." msgstr "" -#: ../../reference/compound_stmts.rst:881 +#: ../../reference/compound_stmts.rst:878 msgid "" "In simple terms ``NAME`` will always succeed and it will set ``NAME = " "``." msgstr "" -#: ../../reference/compound_stmts.rst:886 +#: ../../reference/compound_stmts.rst:883 msgid "Wildcard Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:888 +#: ../../reference/compound_stmts.rst:885 msgid "" "A wildcard pattern always succeeds (matches anything) and binds no name. " "Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:894 +#: ../../reference/compound_stmts.rst:891 msgid "" "``_`` is a :ref:`soft keyword ` within any pattern, but only " "within patterns. It is an identifier, as usual, even within ``match`` " "subject expressions, ``guard``\\ s, and ``case`` blocks." msgstr "" -#: ../../reference/compound_stmts.rst:898 +#: ../../reference/compound_stmts.rst:895 msgid "In simple terms, ``_`` will always succeed." msgstr "" -#: ../../reference/compound_stmts.rst:903 +#: ../../reference/compound_stmts.rst:900 msgid "Value Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:905 +#: ../../reference/compound_stmts.rst:902 msgid "A value pattern represents a named value in Python. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:913 +#: ../../reference/compound_stmts.rst:910 msgid "" "The dotted name in the pattern is looked up using standard Python :ref:`name " "resolution rules `. The pattern succeeds if the value found " "compares equal to the subject value (using the ``==`` equality operator)." msgstr "" -#: ../../reference/compound_stmts.rst:918 +#: ../../reference/compound_stmts.rst:915 msgid "" "In simple terms ``NAME1.NAME2`` will succeed only if `` == NAME1." "NAME2``" msgstr "" -#: ../../reference/compound_stmts.rst:922 +#: ../../reference/compound_stmts.rst:919 msgid "" "If the same value occurs multiple times in the same match statement, the " "interpreter may cache the first value found and reuse it rather than repeat " @@ -900,44 +898,44 @@ msgid "" "given match statement." msgstr "" -#: ../../reference/compound_stmts.rst:930 +#: ../../reference/compound_stmts.rst:927 msgid "Group Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:932 +#: ../../reference/compound_stmts.rst:929 msgid "" "A group pattern allows users to add parentheses around patterns to emphasize " "the intended grouping. Otherwise, it has no additional syntax. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:939 +#: ../../reference/compound_stmts.rst:936 msgid "In simple terms ``(P)`` has the same effect as ``P``." msgstr "" -#: ../../reference/compound_stmts.rst:944 +#: ../../reference/compound_stmts.rst:941 msgid "Sequence Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:946 +#: ../../reference/compound_stmts.rst:943 msgid "" "A sequence pattern contains several subpatterns to be matched against " "sequence elements. The syntax is similar to the unpacking of a list or tuple." msgstr "" -#: ../../reference/compound_stmts.rst:957 +#: ../../reference/compound_stmts.rst:954 msgid "" "There is no difference if parentheses or square brackets are used for " "sequence patterns (i.e. ``(...)`` vs ``[...]`` )." msgstr "" -#: ../../reference/compound_stmts.rst:961 +#: ../../reference/compound_stmts.rst:958 msgid "" "A single pattern enclosed in parentheses without a trailing comma (e.g. ``(3 " "| 4)``) is a :ref:`group pattern `. While a single pattern " "enclosed in square brackets (e.g. ``[3 | 4]``) is still a sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:966 +#: ../../reference/compound_stmts.rst:963 msgid "" "At most one star subpattern may be in a sequence pattern. The star " "subpattern may occur in any position. If no star subpattern is present, the " @@ -945,40 +943,40 @@ msgid "" "variable-length sequence pattern." msgstr "" -#: ../../reference/compound_stmts.rst:971 +#: ../../reference/compound_stmts.rst:968 msgid "" "The following is the logical flow for matching a sequence pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:974 +#: ../../reference/compound_stmts.rst:971 msgid "" "If the subject value is not a sequence [#]_, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:977 +#: ../../reference/compound_stmts.rst:974 msgid "" "If the subject value is an instance of ``str``, ``bytes`` or ``bytearray`` " "the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:980 +#: ../../reference/compound_stmts.rst:977 msgid "" "The subsequent steps depend on whether the sequence pattern is fixed or " "variable-length." msgstr "" -#: ../../reference/compound_stmts.rst:983 +#: ../../reference/compound_stmts.rst:980 msgid "If the sequence pattern is fixed-length:" msgstr "" -#: ../../reference/compound_stmts.rst:985 +#: ../../reference/compound_stmts.rst:982 msgid "" "If the length of the subject sequence is not equal to the number of " "subpatterns, the sequence pattern fails" msgstr "" -#: ../../reference/compound_stmts.rst:988 +#: ../../reference/compound_stmts.rst:985 msgid "" "Subpatterns in the sequence pattern are matched to their corresponding items " "in the subject sequence from left to right. Matching stops as soon as a " @@ -986,118 +984,118 @@ msgid "" "corresponding item, the sequence pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:993 +#: ../../reference/compound_stmts.rst:990 msgid "Otherwise, if the sequence pattern is variable-length:" msgstr "" -#: ../../reference/compound_stmts.rst:995 +#: ../../reference/compound_stmts.rst:992 msgid "" "If the length of the subject sequence is less than the number of non-star " "subpatterns, the sequence pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:998 +#: ../../reference/compound_stmts.rst:995 msgid "" "The leading non-star subpatterns are matched to their corresponding items as " "for fixed-length sequences." msgstr "" -#: ../../reference/compound_stmts.rst:1001 +#: ../../reference/compound_stmts.rst:998 msgid "" "If the previous step succeeds, the star subpattern matches a list formed of " "the remaining subject items, excluding the remaining items corresponding to " "non-star subpatterns following the star subpattern." msgstr "" -#: ../../reference/compound_stmts.rst:1005 +#: ../../reference/compound_stmts.rst:1002 msgid "" "Remaining non-star subpatterns are matched to their corresponding subject " "items, as for a fixed-length sequence." msgstr "" -#: ../../reference/compound_stmts.rst:1008 +#: ../../reference/compound_stmts.rst:1005 msgid "" "The length of the subject sequence is obtained via :func:`len` (i.e. via " "the :meth:`__len__` protocol). This length may be cached by the interpreter " "in a similar manner as :ref:`value patterns `." msgstr "" -#: ../../reference/compound_stmts.rst:1014 +#: ../../reference/compound_stmts.rst:1011 msgid "" "In simple terms ``[P1, P2, P3,`` ... ``, P]`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1017 +#: ../../reference/compound_stmts.rst:1014 msgid "check ```` is a sequence" msgstr "" -#: ../../reference/compound_stmts.rst:1018 +#: ../../reference/compound_stmts.rst:1015 msgid "``len(subject) == ``" msgstr "``len(subject) == ``" -#: ../../reference/compound_stmts.rst:1019 +#: ../../reference/compound_stmts.rst:1016 msgid "" "``P1`` matches ``[0]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1020 +#: ../../reference/compound_stmts.rst:1017 msgid "" "``P2`` matches ``[1]`` (note that this match can also bind names)" msgstr "" -#: ../../reference/compound_stmts.rst:1021 +#: ../../reference/compound_stmts.rst:1018 msgid "... and so on for the corresponding pattern/element." msgstr "" -#: ../../reference/compound_stmts.rst:1026 +#: ../../reference/compound_stmts.rst:1023 msgid "Mapping Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1028 +#: ../../reference/compound_stmts.rst:1025 msgid "" "A mapping pattern contains one or more key-value patterns. The syntax is " "similar to the construction of a dictionary. Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1039 +#: ../../reference/compound_stmts.rst:1036 msgid "" "At most one double star pattern may be in a mapping pattern. The double " "star pattern must be the last subpattern in the mapping pattern." msgstr "" -#: ../../reference/compound_stmts.rst:1042 +#: ../../reference/compound_stmts.rst:1039 msgid "" "Duplicate keys in mapping patterns are disallowed. Duplicate literal keys " "will raise a :exc:`SyntaxError`. Two keys that otherwise have the same value " "will raise a :exc:`ValueError` at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1046 +#: ../../reference/compound_stmts.rst:1043 msgid "" "The following is the logical flow for matching a mapping pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1049 +#: ../../reference/compound_stmts.rst:1046 msgid "If the subject value is not a mapping [#]_,the mapping pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1051 +#: ../../reference/compound_stmts.rst:1048 msgid "" "If every key given in the mapping pattern is present in the subject mapping, " "and the pattern for each key matches the corresponding item of the subject " "mapping, the mapping pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1055 +#: ../../reference/compound_stmts.rst:1052 msgid "" "If duplicate keys are detected in the mapping pattern, the pattern is " "considered invalid. A :exc:`SyntaxError` is raised for duplicate literal " "values; or a :exc:`ValueError` for named keys of the same value." msgstr "" -#: ../../reference/compound_stmts.rst:1059 +#: ../../reference/compound_stmts.rst:1056 msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " @@ -1105,256 +1103,256 @@ msgid "" "`__getitem__`." msgstr "" -#: ../../reference/compound_stmts.rst:1064 +#: ../../reference/compound_stmts.rst:1061 msgid "" "In simple terms ``{KEY1: P1, KEY2: P2, ... }`` matches only if all the " "following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1067 +#: ../../reference/compound_stmts.rst:1064 msgid "check ```` is a mapping" msgstr "" -#: ../../reference/compound_stmts.rst:1068 +#: ../../reference/compound_stmts.rst:1065 msgid "``KEY1 in ``" msgstr "``KEY1 in ``" -#: ../../reference/compound_stmts.rst:1069 +#: ../../reference/compound_stmts.rst:1066 msgid "``P1`` matches ``[KEY1]``" msgstr "" -#: ../../reference/compound_stmts.rst:1070 +#: ../../reference/compound_stmts.rst:1067 msgid "... and so on for the corresponding KEY/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1076 +#: ../../reference/compound_stmts.rst:1073 msgid "Class Patterns" msgstr "" -#: ../../reference/compound_stmts.rst:1078 +#: ../../reference/compound_stmts.rst:1075 msgid "" "A class pattern represents a class and its positional and keyword arguments " "(if any). Syntax:" msgstr "" -#: ../../reference/compound_stmts.rst:1089 +#: ../../reference/compound_stmts.rst:1086 msgid "The same keyword should not be repeated in class patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1091 +#: ../../reference/compound_stmts.rst:1088 msgid "" "The following is the logical flow for matching a class pattern against a " "subject value:" msgstr "" -#: ../../reference/compound_stmts.rst:1094 +#: ../../reference/compound_stmts.rst:1091 msgid "" "If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" "exc:`TypeError`." msgstr "" -#: ../../reference/compound_stmts.rst:1097 +#: ../../reference/compound_stmts.rst:1094 msgid "" "If the subject value is not an instance of ``name_or_attr`` (tested via :" "func:`isinstance`), the class pattern fails." msgstr "" -#: ../../reference/compound_stmts.rst:1100 +#: ../../reference/compound_stmts.rst:1097 msgid "" "If no pattern arguments are present, the pattern succeeds. Otherwise, the " "subsequent steps depend on whether keyword or positional argument patterns " "are present." msgstr "" -#: ../../reference/compound_stmts.rst:1104 +#: ../../reference/compound_stmts.rst:1101 msgid "" "For a number of built-in types (specified below), a single positional " "subpattern is accepted which will match the entire subject; for these types " "keyword patterns also work as for other types." msgstr "" -#: ../../reference/compound_stmts.rst:1108 +#: ../../reference/compound_stmts.rst:1105 msgid "" "If only keyword patterns are present, they are processed as follows, one by " "one:" msgstr "" -#: ../../reference/compound_stmts.rst:1111 +#: ../../reference/compound_stmts.rst:1108 msgid "I. The keyword is looked up as an attribute on the subject." msgstr "" -#: ../../reference/compound_stmts.rst:1113 +#: ../../reference/compound_stmts.rst:1110 msgid "" "If this raises an exception other than :exc:`AttributeError`, the exception " "bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1116 +#: ../../reference/compound_stmts.rst:1113 msgid "If this raises :exc:`AttributeError`, the class pattern has failed." msgstr "" -#: ../../reference/compound_stmts.rst:1118 +#: ../../reference/compound_stmts.rst:1115 msgid "" "Else, the subpattern associated with the keyword pattern is matched against " "the subject's attribute value. If this fails, the class pattern fails; if " "this succeeds, the match proceeds to the next keyword." msgstr "" -#: ../../reference/compound_stmts.rst:1123 +#: ../../reference/compound_stmts.rst:1120 msgid "II. If all keyword patterns succeed, the class pattern succeeds." msgstr "" -#: ../../reference/compound_stmts.rst:1125 +#: ../../reference/compound_stmts.rst:1122 msgid "" "If any positional patterns are present, they are converted to keyword " "patterns using the :data:`~object.__match_args__` attribute on the class " "``name_or_attr`` before matching:" msgstr "" -#: ../../reference/compound_stmts.rst:1129 +#: ../../reference/compound_stmts.rst:1126 msgid "" "I. The equivalent of ``getattr(cls, \"__match_args__\", ())`` is called." msgstr "" -#: ../../reference/compound_stmts.rst:1131 +#: ../../reference/compound_stmts.rst:1128 msgid "If this raises an exception, the exception bubbles up." msgstr "" -#: ../../reference/compound_stmts.rst:1133 +#: ../../reference/compound_stmts.rst:1130 msgid "" "If the returned value is not a tuple, the conversion fails and :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1136 +#: ../../reference/compound_stmts.rst:1133 msgid "" "If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" "`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1139 +#: ../../reference/compound_stmts.rst:1136 msgid "" "Otherwise, positional pattern ``i`` is converted to a keyword pattern using " "``__match_args__[i]`` as the keyword. ``__match_args__[i]`` must be a " "string; if not :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1143 +#: ../../reference/compound_stmts.rst:1140 msgid "If there are duplicate keywords, :exc:`TypeError` is raised." msgstr "" -#: ../../reference/compound_stmts.rst:1145 +#: ../../reference/compound_stmts.rst:1142 msgid ":ref:`class-pattern-matching`" msgstr ":ref:`class-pattern-matching`" -#: ../../reference/compound_stmts.rst:1148 +#: ../../reference/compound_stmts.rst:1145 msgid "" "II. Once all positional patterns have been converted to keyword patterns," msgstr "" -#: ../../reference/compound_stmts.rst:1148 +#: ../../reference/compound_stmts.rst:1145 msgid "the match proceeds as if there were only keyword patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1150 +#: ../../reference/compound_stmts.rst:1147 msgid "" "For the following built-in types the handling of positional subpatterns is " "different:" msgstr "" -#: ../../reference/compound_stmts.rst:1153 +#: ../../reference/compound_stmts.rst:1150 msgid ":class:`bool`" msgstr ":class:`bool`" -#: ../../reference/compound_stmts.rst:1154 +#: ../../reference/compound_stmts.rst:1151 msgid ":class:`bytearray`" msgstr ":class:`bytearray`" -#: ../../reference/compound_stmts.rst:1155 +#: ../../reference/compound_stmts.rst:1152 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../reference/compound_stmts.rst:1156 +#: ../../reference/compound_stmts.rst:1153 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1154 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../reference/compound_stmts.rst:1158 +#: ../../reference/compound_stmts.rst:1155 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../reference/compound_stmts.rst:1159 +#: ../../reference/compound_stmts.rst:1156 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../reference/compound_stmts.rst:1160 -#: ../../reference/compound_stmts.rst:1611 +#: ../../reference/compound_stmts.rst:1157 +#: ../../reference/compound_stmts.rst:1608 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../reference/compound_stmts.rst:1161 +#: ../../reference/compound_stmts.rst:1158 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../reference/compound_stmts.rst:1162 +#: ../../reference/compound_stmts.rst:1159 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../reference/compound_stmts.rst:1163 -#: ../../reference/compound_stmts.rst:1614 +#: ../../reference/compound_stmts.rst:1160 +#: ../../reference/compound_stmts.rst:1611 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../reference/compound_stmts.rst:1165 +#: ../../reference/compound_stmts.rst:1162 msgid "" "These classes accept a single positional argument, and the pattern there is " "matched against the whole object rather than an attribute. For example " "``int(0|1)`` matches the value ``0``, but not the value ``0.0``." msgstr "" -#: ../../reference/compound_stmts.rst:1169 +#: ../../reference/compound_stmts.rst:1166 msgid "" "In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:" msgstr "" -#: ../../reference/compound_stmts.rst:1171 +#: ../../reference/compound_stmts.rst:1168 msgid "``isinstance(, CLS)``" msgstr "``isinstance(, CLS)``" -#: ../../reference/compound_stmts.rst:1172 +#: ../../reference/compound_stmts.rst:1169 msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1171 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1171 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1172 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1176 +#: ../../reference/compound_stmts.rst:1173 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1191 +#: ../../reference/compound_stmts.rst:1188 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1206 +#: ../../reference/compound_stmts.rst:1203 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1225 +#: ../../reference/compound_stmts.rst:1222 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1363,13 +1361,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1231 +#: ../../reference/compound_stmts.rst:1228 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1237 +#: ../../reference/compound_stmts.rst:1234 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1380,28 +1378,28 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1248 -#: ../../reference/compound_stmts.rst:1425 +#: ../../reference/compound_stmts.rst:1245 +#: ../../reference/compound_stmts.rst:1422 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1253 +#: ../../reference/compound_stmts.rst:1250 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1255 +#: ../../reference/compound_stmts.rst:1252 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1265 +#: ../../reference/compound_stmts.rst:1262 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1412,7 +1410,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1270 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1425,7 +1423,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1294 +#: ../../reference/compound_stmts.rst:1291 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1441,13 +1439,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1306 +#: ../../reference/compound_stmts.rst:1303 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1315 +#: ../../reference/compound_stmts.rst:1312 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1464,7 +1462,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1330 +#: ../../reference/compound_stmts.rst:1327 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1476,7 +1474,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1338 +#: ../../reference/compound_stmts.rst:1335 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1485,51 +1483,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1347 +#: ../../reference/compound_stmts.rst:1344 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1347 +#: ../../reference/compound_stmts.rst:1344 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1350 +#: ../../reference/compound_stmts.rst:1347 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1350 +#: ../../reference/compound_stmts.rst:1347 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1354 +#: ../../reference/compound_stmts.rst:1351 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1353 +#: ../../reference/compound_stmts.rst:1350 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1357 +#: ../../reference/compound_stmts.rst:1354 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1357 +#: ../../reference/compound_stmts.rst:1354 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1364 +#: ../../reference/compound_stmts.rst:1361 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1379 +#: ../../reference/compound_stmts.rst:1376 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1386 +#: ../../reference/compound_stmts.rst:1383 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1538,11 +1536,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1395 +#: ../../reference/compound_stmts.rst:1392 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1400 +#: ../../reference/compound_stmts.rst:1397 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1554,7 +1552,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1409 +#: ../../reference/compound_stmts.rst:1406 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1562,30 +1560,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1414 +#: ../../reference/compound_stmts.rst:1411 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1419 +#: ../../reference/compound_stmts.rst:1416 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1427 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1433 +#: ../../reference/compound_stmts.rst:1430 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1438 +#: ../../reference/compound_stmts.rst:1435 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1598,35 +1596,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1453 +#: ../../reference/compound_stmts.rst:1450 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1451 +#: ../../reference/compound_stmts.rst:1448 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1456 +#: ../../reference/compound_stmts.rst:1453 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1456 +#: ../../reference/compound_stmts.rst:1453 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1463 +#: ../../reference/compound_stmts.rst:1460 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1471 +#: ../../reference/compound_stmts.rst:1468 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1481 +#: ../../reference/compound_stmts.rst:1478 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1634,189 +1632,189 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1485 +#: ../../reference/compound_stmts.rst:1482 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1488 +#: ../../reference/compound_stmts.rst:1485 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1491 +#: ../../reference/compound_stmts.rst:1488 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1494 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1505 +#: ../../reference/compound_stmts.rst:1502 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1510 +#: ../../reference/compound_stmts.rst:1507 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1514 +#: ../../reference/compound_stmts.rst:1511 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1524 +#: ../../reference/compound_stmts.rst:1521 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1537 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1542 +#: ../../reference/compound_stmts.rst:1539 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1550 +#: ../../reference/compound_stmts.rst:1547 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1555 +#: ../../reference/compound_stmts.rst:1552 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1582 +#: ../../reference/compound_stmts.rst:1579 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1584 +#: ../../reference/compound_stmts.rst:1581 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1590 +#: ../../reference/compound_stmts.rst:1587 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1590 +#: ../../reference/compound_stmts.rst:1587 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1595 +#: ../../reference/compound_stmts.rst:1592 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1596 +#: ../../reference/compound_stmts.rst:1593 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1600 +#: ../../reference/compound_stmts.rst:1597 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1602 +#: ../../reference/compound_stmts.rst:1599 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1603 +#: ../../reference/compound_stmts.rst:1600 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1604 +#: ../../reference/compound_stmts.rst:1601 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1605 -#: ../../reference/compound_stmts.rst:1624 +#: ../../reference/compound_stmts.rst:1602 +#: ../../reference/compound_stmts.rst:1621 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1604 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1609 +#: ../../reference/compound_stmts.rst:1606 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1610 +#: ../../reference/compound_stmts.rst:1607 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1612 +#: ../../reference/compound_stmts.rst:1609 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1610 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1616 +#: ../../reference/compound_stmts.rst:1613 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1619 +#: ../../reference/compound_stmts.rst:1616 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1621 +#: ../../reference/compound_stmts.rst:1618 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1622 +#: ../../reference/compound_stmts.rst:1619 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1623 +#: ../../reference/compound_stmts.rst:1620 msgid "" "a builtin class that has its (CPython) :data:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1626 +#: ../../reference/compound_stmts.rst:1623 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1629 +#: ../../reference/compound_stmts.rst:1626 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1633 +#: ../../reference/compound_stmts.rst:1630 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" diff --git a/reference/datamodel.po b/reference/datamodel.po index 9daacde50a..649eb6de1f 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-02-22 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1156,7 +1156,7 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1220 msgid "Internal types" msgstr "" @@ -1357,18 +1357,18 @@ msgstr "" msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1176 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1127 +#: ../../reference/datamodel.rst:1128 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1131 +#: ../../reference/datamodel.rst:1132 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1378,21 +1378,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1139 +#: ../../reference/datamodel.rst:1140 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1144 +#: ../../reference/datamodel.rst:1145 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1154 +#: ../../reference/datamodel.rst:1155 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1402,47 +1402,47 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1163 +#: ../../reference/datamodel.rst:1164 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." msgstr "" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1170 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1173 +#: ../../reference/datamodel.rst:1174 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1202 +#: ../../reference/datamodel.rst:1203 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1180 +#: ../../reference/datamodel.rst:1181 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1189 +#: ../../reference/datamodel.rst:1190 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1193 +#: ../../reference/datamodel.rst:1194 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1197 +#: ../../reference/datamodel.rst:1198 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1452,11 +1452,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1211 +#: ../../reference/datamodel.rst:1212 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1205 +#: ../../reference/datamodel.rst:1206 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1467,11 +1467,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1220 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1214 +#: ../../reference/datamodel.rst:1215 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1480,11 +1480,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1224 +#: ../../reference/datamodel.rst:1225 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1230 +#: ../../reference/datamodel.rst:1231 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1498,7 +1498,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1241 +#: ../../reference/datamodel.rst:1242 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1507,7 +1507,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1247 +#: ../../reference/datamodel.rst:1248 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1517,11 +1517,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1258 +#: ../../reference/datamodel.rst:1259 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1264 +#: ../../reference/datamodel.rst:1265 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1531,7 +1531,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1271 +#: ../../reference/datamodel.rst:1272 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1539,7 +1539,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1277 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1548,13 +1548,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1281 +#: ../../reference/datamodel.rst:1282 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1284 +#: ../../reference/datamodel.rst:1285 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1562,7 +1562,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1293 +#: ../../reference/datamodel.rst:1294 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1572,7 +1572,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1300 +#: ../../reference/datamodel.rst:1301 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1580,7 +1580,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1313 +#: ../../reference/datamodel.rst:1314 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1589,7 +1589,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1319 +#: ../../reference/datamodel.rst:1320 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1599,20 +1599,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1326 +#: ../../reference/datamodel.rst:1327 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1331 +#: ../../reference/datamodel.rst:1332 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1336 +#: ../../reference/datamodel.rst:1337 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1623,18 +1623,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1346 +#: ../../reference/datamodel.rst:1347 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1350 +#: ../../reference/datamodel.rst:1351 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1354 +#: ../../reference/datamodel.rst:1355 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1643,7 +1643,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1360 +#: ../../reference/datamodel.rst:1361 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1654,7 +1654,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1375 +#: ../../reference/datamodel.rst:1376 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1666,13 +1666,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1384 +#: ../../reference/datamodel.rst:1385 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1395 +#: ../../reference/datamodel.rst:1396 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1680,26 +1680,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1400 +#: ../../reference/datamodel.rst:1401 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1404 +#: ../../reference/datamodel.rst:1405 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1414 +#: ../../reference/datamodel.rst:1415 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1426 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1711,28 +1711,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1435 +#: ../../reference/datamodel.rst:1436 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1437 +#: ../../reference/datamodel.rst:1438 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1439 +#: ../../reference/datamodel.rst:1440 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1443 +#: ../../reference/datamodel.rst:1444 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1459 +#: ../../reference/datamodel.rst:1460 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1548 +#: ../../reference/datamodel.rst:1549 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1851,7 +1851,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1558 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1859,7 +1859,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1562 +#: ../../reference/datamodel.rst:1563 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1867,22 +1867,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1567 +#: ../../reference/datamodel.rst:1568 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1571 +#: ../../reference/datamodel.rst:1572 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:1574 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1582 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1891,18 +1891,18 @@ msgid "" "`__len__` nor :meth:`__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1592 +#: ../../reference/datamodel.rst:1593 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1594 +#: ../../reference/datamodel.rst:1595 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1602 +#: ../../reference/datamodel.rst:1603 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1912,7 +1912,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1609 +#: ../../reference/datamodel.rst:1610 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1925,7 +1925,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1622 +#: ../../reference/datamodel.rst:1623 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1937,7 +1937,7 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1633 +#: ../../reference/datamodel.rst:1634 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " @@ -1950,20 +1950,20 @@ msgid "" "arguments ``obj``, ``name``." msgstr "" -#: ../../reference/datamodel.rst:1639 +#: ../../reference/datamodel.rst:1640 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1646 +#: ../../reference/datamodel.rst:1647 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1650 +#: ../../reference/datamodel.rst:1651 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." @@ -1976,14 +1976,14 @@ msgid "" "arguments ``obj``, ``name``, ``value``." msgstr "" -#: ../../reference/datamodel.rst:1656 +#: ../../reference/datamodel.rst:1657 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1663 +#: ../../reference/datamodel.rst:1664 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " @@ -1996,23 +1996,23 @@ msgid "" "arguments ``obj``, ``name``." msgstr "" -#: ../../reference/datamodel.rst:1668 +#: ../../reference/datamodel.rst:1669 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1675 +#: ../../reference/datamodel.rst:1676 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1681 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1687 +#: ../../reference/datamodel.rst:1688 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2024,21 +2024,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1697 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1700 +#: ../../reference/datamodel.rst:1701 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1718 +#: ../../reference/datamodel.rst:1719 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2046,27 +2046,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1723 +#: ../../reference/datamodel.rst:1724 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1726 +#: ../../reference/datamodel.rst:1727 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1731 +#: ../../reference/datamodel.rst:1732 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1732 +#: ../../reference/datamodel.rst:1733 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1738 +#: ../../reference/datamodel.rst:1739 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1740 +#: ../../reference/datamodel.rst:1741 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2076,7 +2076,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1750 +#: ../../reference/datamodel.rst:1751 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2085,13 +2085,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1756 +#: ../../reference/datamodel.rst:1757 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1759 +#: ../../reference/datamodel.rst:1760 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2101,25 +2101,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1768 +#: ../../reference/datamodel.rst:1769 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1771 +#: ../../reference/datamodel.rst:1772 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1777 +#: ../../reference/datamodel.rst:1778 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1780 +#: ../../reference/datamodel.rst:1781 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2130,11 +2130,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1791 +#: ../../reference/datamodel.rst:1792 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1794 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2143,7 +2143,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1799 +#: ../../reference/datamodel.rst:1800 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2151,7 +2151,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1804 +#: ../../reference/datamodel.rst:1805 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2159,54 +2159,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1809 +#: ../../reference/datamodel.rst:1810 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1814 +#: ../../reference/datamodel.rst:1815 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1813 +#: ../../reference/datamodel.rst:1814 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1819 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1817 +#: ../../reference/datamodel.rst:1818 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1822 +#: ../../reference/datamodel.rst:1823 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1821 +#: ../../reference/datamodel.rst:1822 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:1829 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1825 +#: ../../reference/datamodel.rst:1826 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:1862 +#: ../../reference/datamodel.rst:1863 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2223,7 +2223,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1876 +#: ../../reference/datamodel.rst:1877 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2232,30 +2232,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:1882 +#: ../../reference/datamodel.rst:1883 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:1889 +#: ../../reference/datamodel.rst:1890 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:1891 +#: ../../reference/datamodel.rst:1892 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:1895 +#: ../../reference/datamodel.rst:1896 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:1900 +#: ../../reference/datamodel.rst:1901 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2263,18 +2263,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:1910 +#: ../../reference/datamodel.rst:1911 msgid "Notes on using *__slots__*" msgstr "" -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:1913 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:1916 +#: ../../reference/datamodel.rst:1917 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2283,7 +2283,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1923 +#: ../../reference/datamodel.rst:1924 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2291,7 +2291,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1929 +#: ../../reference/datamodel.rst:1930 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2299,7 +2299,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:1936 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2308,7 +2308,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:1941 +#: ../../reference/datamodel.rst:1942 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2317,18 +2317,18 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:1946 +#: ../../reference/datamodel.rst:1947 msgid "" "Nonempty *__slots__* does not work for classes derived from \"variable-" "length\" built-in types such as :class:`int`, :class:`bytes` and :class:" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1949 +#: ../../reference/datamodel.rst:1950 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1951 +#: ../../reference/datamodel.rst:1952 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2336,13 +2336,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:1956 +#: ../../reference/datamodel.rst:1957 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1959 +#: ../../reference/datamodel.rst:1960 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2350,18 +2350,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1965 +#: ../../reference/datamodel.rst:1966 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:1973 +#: ../../reference/datamodel.rst:1974 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:1976 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2371,14 +2371,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:1984 +#: ../../reference/datamodel.rst:1985 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:1988 +#: ../../reference/datamodel.rst:1989 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2386,13 +2386,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2002 +#: ../../reference/datamodel.rst:2003 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2007 +#: ../../reference/datamodel.rst:2008 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2400,41 +2400,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2015 +#: ../../reference/datamodel.rst:2016 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2020 +#: ../../reference/datamodel.rst:2021 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2026 +#: ../../reference/datamodel.rst:2027 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2037 +#: ../../reference/datamodel.rst:2038 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2045 +#: ../../reference/datamodel.rst:2046 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2052 +#: ../../reference/datamodel.rst:2053 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2056 +#: ../../reference/datamodel.rst:2057 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2442,41 +2442,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2071 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2073 +#: ../../reference/datamodel.rst:2074 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:2076 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2076 +#: ../../reference/datamodel.rst:2077 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2077 +#: ../../reference/datamodel.rst:2078 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2079 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2079 +#: ../../reference/datamodel.rst:2080 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2083 +#: ../../reference/datamodel.rst:2084 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2085 +#: ../../reference/datamodel.rst:2086 msgid "" "If a base that appears in class definition is not an instance of :class:" "`type`, then an ``__mro_entries__`` method is searched on it. If found, it " @@ -2485,37 +2485,37 @@ msgid "" "such case the original base is ignored." msgstr "" -#: ../../reference/datamodel.rst:2093 +#: ../../reference/datamodel.rst:2094 msgid ":pep:`560` - Core support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2098 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2101 +#: ../../reference/datamodel.rst:2102 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2104 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2104 +#: ../../reference/datamodel.rst:2105 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2107 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2109 +#: ../../reference/datamodel.rst:2110 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2524,11 +2524,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2119 +#: ../../reference/datamodel.rst:2120 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2124 +#: ../../reference/datamodel.rst:2125 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2540,25 +2540,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2134 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2138 +#: ../../reference/datamodel.rst:2139 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2140 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2143 +#: ../../reference/datamodel.rst:2144 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2148 +#: ../../reference/datamodel.rst:2149 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2567,7 +2567,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2154 +#: ../../reference/datamodel.rst:2155 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2576,11 +2576,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2163 +#: ../../reference/datamodel.rst:2164 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2170 +#: ../../reference/datamodel.rst:2171 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2588,7 +2588,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2175 +#: ../../reference/datamodel.rst:2176 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2599,7 +2599,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2185 +#: ../../reference/datamodel.rst:2186 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2608,39 +2608,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2191 +#: ../../reference/datamodel.rst:2192 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2195 +#: ../../reference/datamodel.rst:2196 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2197 +#: ../../reference/datamodel.rst:2198 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2200 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2203 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2207 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2648,19 +2648,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2213 +#: ../../reference/datamodel.rst:2214 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2215 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2219 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2221 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2668,17 +2668,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2227 +#: ../../reference/datamodel.rst:2228 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2230 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2233 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2686,21 +2686,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2239 +#: ../../reference/datamodel.rst:2240 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2246 +#: ../../reference/datamodel.rst:2247 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2251 +#: ../../reference/datamodel.rst:2252 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2708,11 +2708,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2262 +#: ../../reference/datamodel.rst:2263 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2259 +#: ../../reference/datamodel.rst:2260 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2721,11 +2721,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2267 +#: ../../reference/datamodel.rst:2268 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2269 +#: ../../reference/datamodel.rst:2270 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2733,65 +2733,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2278 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2278 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2281 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2281 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2284 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2283 +#: ../../reference/datamodel.rst:2284 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2287 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2291 +#: ../../reference/datamodel.rst:2292 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2294 +#: ../../reference/datamodel.rst:2295 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2300 +#: ../../reference/datamodel.rst:2301 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2303 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2307 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2800,7 +2800,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2312 +#: ../../reference/datamodel.rst:2313 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2808,11 +2808,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2322 +#: ../../reference/datamodel.rst:2323 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2324 +#: ../../reference/datamodel.rst:2325 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2822,14 +2822,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2332 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2359 +#: ../../reference/datamodel.rst:2360 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2839,40 +2839,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2378 +#: ../../reference/datamodel.rst:2379 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2403 +#: ../../reference/datamodel.rst:2404 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2402 +#: ../../reference/datamodel.rst:2403 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2410 +#: ../../reference/datamodel.rst:2411 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2417 +#: ../../reference/datamodel.rst:2418 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2424 +#: ../../reference/datamodel.rst:2425 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2426 +#: ../../reference/datamodel.rst:2427 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2908,7 +2908,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2466 +#: ../../reference/datamodel.rst:2467 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2916,7 +2916,7 @@ msgid "" "zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2473 +#: ../../reference/datamodel.rst:2474 msgid "" "In CPython, the length is required to be at most :attr:`sys.maxsize`. If the " "length is larger than :attr:`!sys.maxsize` some features (such as :func:" @@ -2925,7 +2925,7 @@ msgid "" "`__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2482 +#: ../../reference/datamodel.rst:2483 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2935,20 +2935,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2496 +#: ../../reference/datamodel.rst:2497 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2500 +#: ../../reference/datamodel.rst:2501 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:2505 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2509 +#: ../../reference/datamodel.rst:2510 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -2961,20 +2961,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:2522 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2526 +#: ../../reference/datamodel.rst:2527 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2535 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2983,7 +2983,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2543 +#: ../../reference/datamodel.rst:2544 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -2992,13 +2992,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2552 +#: ../../reference/datamodel.rst:2553 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2559 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3006,14 +3006,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2566 +#: ../../reference/datamodel.rst:2567 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2570 +#: ../../reference/datamodel.rst:2571 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3022,7 +3022,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2578 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3030,14 +3030,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2584 +#: ../../reference/datamodel.rst:2585 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2588 +#: ../../reference/datamodel.rst:2589 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3045,11 +3045,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2598 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2600 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3057,7 +3057,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2625 +#: ../../reference/datamodel.rst:2626 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3071,13 +3071,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2636 +#: ../../reference/datamodel.rst:2637 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2659 +#: ../../reference/datamodel.rst:2660 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3090,13 +3090,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2671 +#: ../../reference/datamodel.rst:2672 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2676 +#: ../../reference/datamodel.rst:2677 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3105,7 +3105,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2697 +#: ../../reference/datamodel.rst:2698 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3121,19 +3121,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2718 +#: ../../reference/datamodel.rst:2719 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2731 +#: ../../reference/datamodel.rst:2732 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2738 +#: ../../reference/datamodel.rst:2739 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3142,14 +3142,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2744 +#: ../../reference/datamodel.rst:2745 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2756 +#: ../../reference/datamodel.rst:2757 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3158,21 +3158,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2762 +#: ../../reference/datamodel.rst:2763 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2766 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2772 +#: ../../reference/datamodel.rst:2773 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2774 +#: ../../reference/datamodel.rst:2775 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3182,32 +3182,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2785 +#: ../../reference/datamodel.rst:2786 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:2789 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2794 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2801 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2804 +#: ../../reference/datamodel.rst:2805 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3215,27 +3215,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2808 +#: ../../reference/datamodel.rst:2809 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2816 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2815 +#: ../../reference/datamodel.rst:2816 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2823 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2824 +#: ../../reference/datamodel.rst:2825 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3243,7 +3243,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2832 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3252,7 +3252,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2837 +#: ../../reference/datamodel.rst:2838 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3262,19 +3262,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2847 +#: ../../reference/datamodel.rst:2848 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2849 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2855 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2856 +#: ../../reference/datamodel.rst:2857 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3282,7 +3282,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2871 +#: ../../reference/datamodel.rst:2872 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3291,21 +3291,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2885 +#: ../../reference/datamodel.rst:2886 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2895 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:2920 +#: ../../reference/datamodel.rst:2921 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3314,36 +3314,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:2931 +#: ../../reference/datamodel.rst:2932 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:2935 +#: ../../reference/datamodel.rst:2936 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:2937 +#: ../../reference/datamodel.rst:2938 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:2943 +#: ../../reference/datamodel.rst:2944 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:2949 +#: ../../reference/datamodel.rst:2950 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:2955 +#: ../../reference/datamodel.rst:2956 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3351,15 +3351,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:2963 +#: ../../reference/datamodel.rst:2964 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:2970 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:2971 +#: ../../reference/datamodel.rst:2972 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3370,18 +3370,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:2979 +#: ../../reference/datamodel.rst:2980 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:2983 +#: ../../reference/datamodel.rst:2984 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:2989 +#: ../../reference/datamodel.rst:2990 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3392,7 +3392,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3000 +#: ../../reference/datamodel.rst:3001 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3403,7 +3403,7 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3011 +#: ../../reference/datamodel.rst:3012 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3413,99 +3413,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3020 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3025 +#: ../../reference/datamodel.rst:3026 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3027 +#: ../../reference/datamodel.rst:3028 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3030 +#: ../../reference/datamodel.rst:3031 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3034 +#: ../../reference/datamodel.rst:3035 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3038 +#: ../../reference/datamodel.rst:3039 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3042 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3058 +#: ../../reference/datamodel.rst:3059 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3063 +#: ../../reference/datamodel.rst:3064 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3071 +#: ../../reference/datamodel.rst:3072 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3073 +#: ../../reference/datamodel.rst:3074 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3076 +#: ../../reference/datamodel.rst:3077 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3080 +#: ../../reference/datamodel.rst:3081 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3085 +#: ../../reference/datamodel.rst:3086 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3088 +#: ../../reference/datamodel.rst:3089 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3101 +#: ../../reference/datamodel.rst:3102 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:3103 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3106 +#: ../../reference/datamodel.rst:3107 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3513,7 +3513,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3112 +#: ../../reference/datamodel.rst:3113 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3521,7 +3521,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3118 +#: ../../reference/datamodel.rst:3119 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall "