diff --git a/library/collections.abc.po b/library/collections.abc.po index f83ca6145f..3c09f72b17 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-20 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,302 +37,308 @@ msgid "" "for example, whether it is hashable or whether it is a mapping." msgstr "" -#: ../../library/collections.abc.rst:31 +#: ../../library/collections.abc.rst:27 +msgid "" +"These abstract classes now support ``[]``. See :ref:`types-genericalias` " +"and :pep:`585`." +msgstr "" + +#: ../../library/collections.abc.rst:34 msgid "Collections Abstract Base Classes" msgstr "" -#: ../../library/collections.abc.rst:33 +#: ../../library/collections.abc.rst:36 msgid "" "The collections module offers the following :term:`ABCs `:" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "ABC" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "Inherits from" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "Abstract Methods" msgstr "" -#: ../../library/collections.abc.rst:38 +#: ../../library/collections.abc.rst:41 msgid "Mixin Methods" msgstr "" -#: ../../library/collections.abc.rst:40 +#: ../../library/collections.abc.rst:43 msgid ":class:`Container`" msgstr "" -#: ../../library/collections.abc.rst:40 +#: ../../library/collections.abc.rst:43 msgid "``__contains__``" msgstr "" -#: ../../library/collections.abc.rst:41 +#: ../../library/collections.abc.rst:44 msgid ":class:`Hashable`" msgstr "" -#: ../../library/collections.abc.rst:41 +#: ../../library/collections.abc.rst:44 msgid "``__hash__``" msgstr "" -#: ../../library/collections.abc.rst:42 ../../library/collections.abc.rst:43 -#: ../../library/collections.abc.rst:44 +#: ../../library/collections.abc.rst:45 ../../library/collections.abc.rst:46 +#: ../../library/collections.abc.rst:47 msgid ":class:`Iterable`" msgstr "" -#: ../../library/collections.abc.rst:42 ../../library/collections.abc.rst:43 +#: ../../library/collections.abc.rst:45 ../../library/collections.abc.rst:46 msgid "``__iter__``" msgstr "" -#: ../../library/collections.abc.rst:43 ../../library/collections.abc.rst:45 +#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:48 msgid ":class:`Iterator`" msgstr "" -#: ../../library/collections.abc.rst:43 +#: ../../library/collections.abc.rst:46 msgid "``__next__``" msgstr "" -#: ../../library/collections.abc.rst:44 +#: ../../library/collections.abc.rst:47 msgid ":class:`Reversible`" msgstr "" -#: ../../library/collections.abc.rst:44 +#: ../../library/collections.abc.rst:47 msgid "``__reversed__``" msgstr "" -#: ../../library/collections.abc.rst:45 +#: ../../library/collections.abc.rst:48 msgid ":class:`Generator`" msgstr "" -#: ../../library/collections.abc.rst:45 ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:96 msgid "``send``, ``throw``" msgstr "" -#: ../../library/collections.abc.rst:45 +#: ../../library/collections.abc.rst:48 msgid "``close``, ``__iter__``, ``__next__``" msgstr "" -#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:85 +#: ../../library/collections.abc.rst:49 ../../library/collections.abc.rst:88 msgid ":class:`Sized`" msgstr "" -#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:85 +#: ../../library/collections.abc.rst:49 ../../library/collections.abc.rst:88 msgid "``__len__``" msgstr "" -#: ../../library/collections.abc.rst:47 +#: ../../library/collections.abc.rst:50 msgid ":class:`Callable`" msgstr "" -#: ../../library/collections.abc.rst:47 +#: ../../library/collections.abc.rst:50 msgid "``__call__``" msgstr "" -#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:64 -#: ../../library/collections.abc.rst:74 +#: ../../library/collections.abc.rst:51 ../../library/collections.abc.rst:67 +#: ../../library/collections.abc.rst:77 msgid ":class:`Collection`" msgstr "" -#: ../../library/collections.abc.rst:48 +#: ../../library/collections.abc.rst:51 msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`" msgstr "" -#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:64 +#: ../../library/collections.abc.rst:51 ../../library/collections.abc.rst:67 msgid "``__contains__``, ``__iter__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:52 ../../library/collections.abc.rst:55 -#: ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:55 ../../library/collections.abc.rst:58 +#: ../../library/collections.abc.rst:64 msgid ":class:`Sequence`" msgstr "" -#: ../../library/collections.abc.rst:52 +#: ../../library/collections.abc.rst:55 msgid ":class:`Reversible`, :class:`Collection`" msgstr "" -#: ../../library/collections.abc.rst:52 ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:55 ../../library/collections.abc.rst:64 msgid "``__getitem__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:52 +#: ../../library/collections.abc.rst:55 msgid "" "``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``" msgstr "" -#: ../../library/collections.abc.rst:55 +#: ../../library/collections.abc.rst:58 msgid ":class:`MutableSequence`" msgstr "" -#: ../../library/collections.abc.rst:55 +#: ../../library/collections.abc.rst:58 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" msgstr "" -#: ../../library/collections.abc.rst:55 +#: ../../library/collections.abc.rst:58 msgid "" "Inherited :class:`Sequence` methods and ``append``, ``reverse``, ``extend``, " "``pop``, ``remove``, and ``__iadd__``" msgstr "" -#: ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:64 msgid ":class:`ByteString`" msgstr "" -#: ../../library/collections.abc.rst:61 +#: ../../library/collections.abc.rst:64 msgid "Inherited :class:`Sequence` methods" msgstr "" -#: ../../library/collections.abc.rst:64 ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:67 ../../library/collections.abc.rst:71 msgid ":class:`Set`" msgstr "" -#: ../../library/collections.abc.rst:64 +#: ../../library/collections.abc.rst:67 msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " "``__and__``, ``__or__``, ``__sub__``, ``__xor__``, and ``isdisjoint``" msgstr "" -#: ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:71 msgid ":class:`MutableSet`" msgstr "" -#: ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:71 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "" -#: ../../library/collections.abc.rst:68 +#: ../../library/collections.abc.rst:71 msgid "" "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" msgstr "" -#: ../../library/collections.abc.rst:74 ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:77 ../../library/collections.abc.rst:81 msgid ":class:`Mapping`" msgstr "" -#: ../../library/collections.abc.rst:74 +#: ../../library/collections.abc.rst:77 msgid "``__getitem__``, ``__iter__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:74 +#: ../../library/collections.abc.rst:77 msgid "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " "``__ne__``" msgstr "" -#: ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:81 msgid ":class:`MutableMapping`" msgstr "" -#: ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:81 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" -#: ../../library/collections.abc.rst:78 +#: ../../library/collections.abc.rst:81 msgid "" "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " "``update``, and ``setdefault``" msgstr "" -#: ../../library/collections.abc.rst:85 +#: ../../library/collections.abc.rst:88 msgid ":class:`MappingView`" msgstr "" -#: ../../library/collections.abc.rst:86 +#: ../../library/collections.abc.rst:89 msgid ":class:`ItemsView`" msgstr "" -#: ../../library/collections.abc.rst:86 ../../library/collections.abc.rst:88 +#: ../../library/collections.abc.rst:89 ../../library/collections.abc.rst:91 msgid ":class:`MappingView`, :class:`Set`" msgstr "" -#: ../../library/collections.abc.rst:86 ../../library/collections.abc.rst:88 -#: ../../library/collections.abc.rst:90 +#: ../../library/collections.abc.rst:89 ../../library/collections.abc.rst:91 +#: ../../library/collections.abc.rst:93 msgid "``__contains__``, ``__iter__``" msgstr "" -#: ../../library/collections.abc.rst:88 +#: ../../library/collections.abc.rst:91 msgid ":class:`KeysView`" msgstr "" -#: ../../library/collections.abc.rst:90 +#: ../../library/collections.abc.rst:93 msgid ":class:`ValuesView`" msgstr "" -#: ../../library/collections.abc.rst:90 +#: ../../library/collections.abc.rst:93 msgid ":class:`MappingView`, :class:`Collection`" msgstr "" -#: ../../library/collections.abc.rst:92 ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:95 ../../library/collections.abc.rst:96 msgid ":class:`Awaitable`" msgstr "" -#: ../../library/collections.abc.rst:92 +#: ../../library/collections.abc.rst:95 msgid "``__await__``" msgstr "" -#: ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:96 msgid ":class:`Coroutine`" msgstr "" -#: ../../library/collections.abc.rst:93 +#: ../../library/collections.abc.rst:96 msgid "``close``" msgstr "" -#: ../../library/collections.abc.rst:94 ../../library/collections.abc.rst:95 +#: ../../library/collections.abc.rst:97 ../../library/collections.abc.rst:98 msgid ":class:`AsyncIterable`" msgstr "" -#: ../../library/collections.abc.rst:94 ../../library/collections.abc.rst:95 +#: ../../library/collections.abc.rst:97 ../../library/collections.abc.rst:98 msgid "``__aiter__``" msgstr "" -#: ../../library/collections.abc.rst:95 ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:98 ../../library/collections.abc.rst:99 msgid ":class:`AsyncIterator`" msgstr "" -#: ../../library/collections.abc.rst:95 +#: ../../library/collections.abc.rst:98 msgid "``__anext__``" msgstr "" -#: ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:99 msgid ":class:`AsyncGenerator`" msgstr "" -#: ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:99 msgid "``asend``, ``athrow``" msgstr "" -#: ../../library/collections.abc.rst:96 +#: ../../library/collections.abc.rst:99 msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "" -#: ../../library/collections.abc.rst:102 +#: ../../library/collections.abc.rst:105 msgid "ABC for classes that provide the :meth:`__contains__` method." msgstr "" -#: ../../library/collections.abc.rst:106 +#: ../../library/collections.abc.rst:109 msgid "ABC for classes that provide the :meth:`__hash__` method." msgstr "" -#: ../../library/collections.abc.rst:110 +#: ../../library/collections.abc.rst:113 msgid "ABC for classes that provide the :meth:`__len__` method." msgstr "" -#: ../../library/collections.abc.rst:114 +#: ../../library/collections.abc.rst:117 msgid "ABC for classes that provide the :meth:`__call__` method." msgstr "" -#: ../../library/collections.abc.rst:118 +#: ../../library/collections.abc.rst:121 msgid "ABC for classes that provide the :meth:`__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:120 +#: ../../library/collections.abc.rst:123 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " @@ -341,22 +347,22 @@ msgid "" "call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:128 +#: ../../library/collections.abc.rst:131 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:134 +#: ../../library/collections.abc.rst:137 msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:140 +#: ../../library/collections.abc.rst:143 msgid "" "ABC for iterable classes that also provide the :meth:`__reversed__` method." msgstr "" -#: ../../library/collections.abc.rst:147 +#: ../../library/collections.abc.rst:150 msgid "" "ABC for generator classes that implement the protocol defined in :pep:`342` " "that extends iterators with the :meth:`~generator.send`, :meth:`~generator." @@ -364,11 +370,11 @@ msgid "" "term:`generator`." msgstr "" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:161 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" -#: ../../library/collections.abc.rst:160 +#: ../../library/collections.abc.rst:163 msgid "" "Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" "meth:`__reversed__` and :meth:`index`, make repeated calls to the " @@ -379,37 +385,37 @@ msgid "" "likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:169 +#: ../../library/collections.abc.rst:172 msgid "The index() method added support for *stop* and *start* arguments." msgstr "" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:179 msgid "ABCs for read-only and mutable sets." msgstr "" -#: ../../library/collections.abc.rst:181 +#: ../../library/collections.abc.rst:184 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -#: ../../library/collections.abc.rst:188 +#: ../../library/collections.abc.rst:191 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" -#: ../../library/collections.abc.rst:192 +#: ../../library/collections.abc.rst:195 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " "expressions. Custom implementations must provide the :meth:`__await__` " "method." msgstr "" -#: ../../library/collections.abc.rst:196 +#: ../../library/collections.abc.rst:199 msgid "" ":term:`Coroutine ` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:200 +#: ../../library/collections.abc.rst:203 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " @@ -418,7 +424,7 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:210 +#: ../../library/collections.abc.rst:213 msgid "" "ABC for coroutine compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" @@ -428,7 +434,7 @@ msgid "" "`coroutine`." msgstr "" -#: ../../library/collections.abc.rst:218 +#: ../../library/collections.abc.rst:221 msgid "" "In CPython, generator-based coroutines (generators decorated with :func:" "`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " @@ -437,31 +443,31 @@ msgid "" "`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:228 +#: ../../library/collections.abc.rst:231 msgid "" "ABC for classes that provide ``__aiter__`` method. See also the definition " "of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:235 +#: ../../library/collections.abc.rst:238 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:242 +#: ../../library/collections.abc.rst:245 msgid "" "ABC for asynchronous generator classes that implement the protocol defined " "in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:248 +#: ../../library/collections.abc.rst:251 msgid "" "These ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:255 +#: ../../library/collections.abc.rst:258 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " @@ -471,11 +477,11 @@ msgid "" "`__and__` and :meth:`isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:284 +#: ../../library/collections.abc.rst:287 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:287 +#: ../../library/collections.abc.rst:290 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an iterable. The class constructor is " @@ -488,14 +494,14 @@ msgid "" "iterable argument." msgstr "" -#: ../../library/collections.abc.rst:298 +#: ../../library/collections.abc.rst:301 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`__le__` and :meth:`__ge__`, then the other " "operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:303 +#: ../../library/collections.abc.rst:306 msgid "" "The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash " "value for the set; however, :meth:`__hash__` is not defined because not all " @@ -504,12 +510,12 @@ msgid "" "Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:311 +#: ../../library/collections.abc.rst:314 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:314 +#: ../../library/collections.abc.rst:317 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "" diff --git a/library/datetime.po b/library/datetime.po index 0231b28f63..183dc63e34 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-20 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,25 +53,33 @@ msgstr "" msgid "Time access and conversions." msgstr "" -#: ../../library/datetime.rst:30 -msgid "Package `dateutil `_" +#: ../../library/datetime.rst:31 +msgid "Module :mod:`zoneinfo`" msgstr "" #: ../../library/datetime.rst:31 +msgid "Concrete time zones representing the IANA time zone database." +msgstr "" + +#: ../../library/datetime.rst:33 +msgid "Package `dateutil `_" +msgstr "" + +#: ../../library/datetime.rst:34 msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:36 +#: ../../library/datetime.rst:39 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:38 +#: ../../library/datetime.rst:41 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:41 +#: ../../library/datetime.rst:44 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -80,7 +88,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:47 +#: ../../library/datetime.rst:50 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -91,7 +99,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:54 +#: ../../library/datetime.rst:57 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -101,7 +109,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:60 +#: ../../library/datetime.rst:63 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -112,38 +120,38 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:69 +#: ../../library/datetime.rst:72 msgid "Constants" msgstr "" -#: ../../library/datetime.rst:71 +#: ../../library/datetime.rst:74 msgid "The :mod:`datetime` module exports the following constants:" msgstr "" -#: ../../library/datetime.rst:75 +#: ../../library/datetime.rst:78 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:81 +#: ../../library/datetime.rst:84 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:85 +#: ../../library/datetime.rst:88 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:90 +#: ../../library/datetime.rst:93 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:98 +#: ../../library/datetime.rst:101 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap seconds" @@ -151,20 +159,20 @@ msgid "" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:107 +#: ../../library/datetime.rst:110 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:115 +#: ../../library/datetime.rst:118 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." msgstr "" -#: ../../library/datetime.rst:122 +#: ../../library/datetime.rst:125 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -172,157 +180,157 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:130 +#: ../../library/datetime.rst:133 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:135 ../../library/datetime.rst:153 +#: ../../library/datetime.rst:138 ../../library/datetime.rst:156 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:137 +#: ../../library/datetime.rst:140 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:148 +#: ../../library/datetime.rst:151 msgid "Common Properties" msgstr "" -#: ../../library/datetime.rst:150 +#: ../../library/datetime.rst:153 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:154 +#: ../../library/datetime.rst:157 msgid "" "Objects of these types are hashable, meaning that they can be used as " "dictionary keys." msgstr "" -#: ../../library/datetime.rst:156 +#: ../../library/datetime.rst:159 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:159 +#: ../../library/datetime.rst:162 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:161 +#: ../../library/datetime.rst:164 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:163 +#: ../../library/datetime.rst:166 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:165 +#: ../../library/datetime.rst:168 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:167 +#: ../../library/datetime.rst:170 msgid "``d.tzinfo`` is not ``None``" msgstr "" -#: ../../library/datetime.rst:168 +#: ../../library/datetime.rst:171 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:170 +#: ../../library/datetime.rst:173 msgid "Otherwise, *d* is naive." msgstr "" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:175 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:177 msgid "``t.tzinfo`` is not ``None``" msgstr "" -#: ../../library/datetime.rst:175 +#: ../../library/datetime.rst:178 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "" -#: ../../library/datetime.rst:177 +#: ../../library/datetime.rst:180 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:179 +#: ../../library/datetime.rst:182 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:185 +#: ../../library/datetime.rst:188 msgid ":class:`timedelta` Objects" msgstr "" -#: ../../library/datetime.rst:187 +#: ../../library/datetime.rst:190 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" -#: ../../library/datetime.rst:192 +#: ../../library/datetime.rst:195 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:195 +#: ../../library/datetime.rst:198 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:198 +#: ../../library/datetime.rst:201 msgid "A millisecond is converted to 1000 microseconds." msgstr "" -#: ../../library/datetime.rst:199 +#: ../../library/datetime.rst:202 msgid "A minute is converted to 60 seconds." msgstr "" -#: ../../library/datetime.rst:200 +#: ../../library/datetime.rst:203 msgid "An hour is converted to 3600 seconds." msgstr "" -#: ../../library/datetime.rst:201 +#: ../../library/datetime.rst:204 msgid "A week is converted to 7 days." msgstr "" -#: ../../library/datetime.rst:203 +#: ../../library/datetime.rst:206 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:206 +#: ../../library/datetime.rst:209 msgid "``0 <= microseconds < 1000000``" msgstr "" -#: ../../library/datetime.rst:207 +#: ../../library/datetime.rst:210 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:208 +#: ../../library/datetime.rst:211 msgid "``-999999999 <= days <= 999999999``" msgstr "" -#: ../../library/datetime.rst:210 +#: ../../library/datetime.rst:213 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:228 +#: ../../library/datetime.rst:231 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -331,281 +339,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:235 +#: ../../library/datetime.rst:238 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:238 +#: ../../library/datetime.rst:241 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:247 ../../library/datetime.rst:541 -#: ../../library/datetime.rst:1048 ../../library/datetime.rst:1666 -#: ../../library/datetime.rst:2260 +#: ../../library/datetime.rst:250 ../../library/datetime.rst:544 +#: ../../library/datetime.rst:1051 ../../library/datetime.rst:1669 +#: ../../library/datetime.rst:2262 msgid "Class attributes:" msgstr "" -#: ../../library/datetime.rst:251 +#: ../../library/datetime.rst:254 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:256 +#: ../../library/datetime.rst:259 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:262 +#: ../../library/datetime.rst:265 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:265 +#: ../../library/datetime.rst:268 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:268 ../../library/datetime.rst:559 -#: ../../library/datetime.rst:1068 ../../library/datetime.rst:1686 +#: ../../library/datetime.rst:271 ../../library/datetime.rst:562 +#: ../../library/datetime.rst:1071 ../../library/datetime.rst:1689 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:271 +#: ../../library/datetime.rst:274 msgid "Attribute" msgstr "" -#: ../../library/datetime.rst:271 +#: ../../library/datetime.rst:274 msgid "Value" msgstr "" -#: ../../library/datetime.rst:273 +#: ../../library/datetime.rst:276 msgid "``days``" msgstr "" -#: ../../library/datetime.rst:273 +#: ../../library/datetime.rst:276 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:275 +#: ../../library/datetime.rst:278 msgid "``seconds``" msgstr "" -#: ../../library/datetime.rst:275 +#: ../../library/datetime.rst:278 msgid "Between 0 and 86399 inclusive" msgstr "" -#: ../../library/datetime.rst:277 +#: ../../library/datetime.rst:280 msgid "``microseconds``" msgstr "" -#: ../../library/datetime.rst:277 +#: ../../library/datetime.rst:280 msgid "Between 0 and 999999 inclusive" msgstr "" -#: ../../library/datetime.rst:280 ../../library/datetime.rst:576 -#: ../../library/datetime.rst:1121 +#: ../../library/datetime.rst:283 ../../library/datetime.rst:579 +#: ../../library/datetime.rst:1124 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:285 ../../library/datetime.rst:579 -#: ../../library/datetime.rst:1124 +#: ../../library/datetime.rst:288 ../../library/datetime.rst:582 +#: ../../library/datetime.rst:1127 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:285 ../../library/datetime.rst:579 -#: ../../library/datetime.rst:1124 +#: ../../library/datetime.rst:288 ../../library/datetime.rst:582 +#: ../../library/datetime.rst:1127 msgid "Result" msgstr "" -#: ../../library/datetime.rst:287 +#: ../../library/datetime.rst:290 msgid "``t1 = t2 + t3``" msgstr "" -#: ../../library/datetime.rst:287 +#: ../../library/datetime.rst:290 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:293 msgid "``t1 = t2 - t3``" msgstr "" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:293 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:294 +#: ../../library/datetime.rst:297 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "" -#: ../../library/datetime.rst:294 +#: ../../library/datetime.rst:297 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:298 +#: ../../library/datetime.rst:301 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:301 +#: ../../library/datetime.rst:304 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "" -#: ../../library/datetime.rst:301 +#: ../../library/datetime.rst:304 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:305 +#: ../../library/datetime.rst:308 msgid "``f = t2 / t3``" msgstr "" -#: ../../library/datetime.rst:305 +#: ../../library/datetime.rst:308 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:309 +#: ../../library/datetime.rst:312 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "" -#: ../../library/datetime.rst:309 +#: ../../library/datetime.rst:312 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:313 +#: ../../library/datetime.rst:316 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "" -#: ../../library/datetime.rst:313 +#: ../../library/datetime.rst:316 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:317 +#: ../../library/datetime.rst:320 msgid "``t1 = t2 % t3``" msgstr "" -#: ../../library/datetime.rst:317 +#: ../../library/datetime.rst:320 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:320 +#: ../../library/datetime.rst:323 msgid "``q, r = divmod(t1, t2)``" msgstr "" -#: ../../library/datetime.rst:320 +#: ../../library/datetime.rst:323 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:325 +#: ../../library/datetime.rst:328 msgid "``+t1``" msgstr "" -#: ../../library/datetime.rst:325 +#: ../../library/datetime.rst:328 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:328 +#: ../../library/datetime.rst:331 msgid "``-t1``" msgstr "" -#: ../../library/datetime.rst:328 +#: ../../library/datetime.rst:331 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:336 msgid "``abs(t)``" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:336 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:336 +#: ../../library/datetime.rst:339 msgid "``str(t)``" msgstr "" -#: ../../library/datetime.rst:336 +#: ../../library/datetime.rst:339 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:340 +#: ../../library/datetime.rst:343 msgid "``repr(t)``" msgstr "" -#: ../../library/datetime.rst:340 +#: ../../library/datetime.rst:343 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:346 ../../library/datetime.rst:593 -#: ../../library/datetime.rst:2473 +#: ../../library/datetime.rst:349 ../../library/datetime.rst:596 +#: ../../library/datetime.rst:2475 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:352 msgid "This is exact but may overflow." msgstr "" -#: ../../library/datetime.rst:352 +#: ../../library/datetime.rst:355 msgid "This is exact and cannot overflow." msgstr "" -#: ../../library/datetime.rst:355 +#: ../../library/datetime.rst:358 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:358 +#: ../../library/datetime.rst:361 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:361 +#: ../../library/datetime.rst:364 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:371 +#: ../../library/datetime.rst:374 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:375 +#: ../../library/datetime.rst:378 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:379 +#: ../../library/datetime.rst:382 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -613,119 +621,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:386 +#: ../../library/datetime.rst:389 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:391 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:399 +#: ../../library/datetime.rst:402 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:410 +#: ../../library/datetime.rst:413 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:413 ../../library/datetime.rst:622 -#: ../../library/datetime.rst:1195 ../../library/datetime.rst:1783 +#: ../../library/datetime.rst:416 ../../library/datetime.rst:625 +#: ../../library/datetime.rst:1198 ../../library/datetime.rst:1786 msgid "Instance methods:" msgstr "" -#: ../../library/datetime.rst:417 +#: ../../library/datetime.rst:420 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:421 +#: ../../library/datetime.rst:424 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:427 +#: ../../library/datetime.rst:430 msgid "Examples of usage: :class:`timedelta`" msgstr "" -#: ../../library/datetime.rst:429 +#: ../../library/datetime.rst:432 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:441 +#: ../../library/datetime.rst:444 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:460 +#: ../../library/datetime.rst:463 msgid ":class:`date` Objects" msgstr "" -#: ../../library/datetime.rst:462 +#: ../../library/datetime.rst:465 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:466 +#: ../../library/datetime.rst:469 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:471 +#: ../../library/datetime.rst:474 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:474 +#: ../../library/datetime.rst:477 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:478 msgid "``1 <= month <= 12``" msgstr "" -#: ../../library/datetime.rst:476 +#: ../../library/datetime.rst:479 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:478 ../../library/datetime.rst:840 +#: ../../library/datetime.rst:481 ../../library/datetime.rst:843 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:481 ../../library/datetime.rst:845 +#: ../../library/datetime.rst:484 ../../library/datetime.rst:848 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:485 +#: ../../library/datetime.rst:488 msgid "Return the current local date." msgstr "" -#: ../../library/datetime.rst:487 +#: ../../library/datetime.rst:490 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "" -#: ../../library/datetime.rst:491 +#: ../../library/datetime.rst:494 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:494 +#: ../../library/datetime.rst:497 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -735,7 +743,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:501 +#: ../../library/datetime.rst:504 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -743,98 +751,98 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:510 +#: ../../library/datetime.rst:513 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:513 +#: ../../library/datetime.rst:516 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:520 +#: ../../library/datetime.rst:523 msgid "" "Return a :class:`date` corresponding to a *date_string* given in the format " "``YYYY-MM-DD``::" msgstr "" -#: ../../library/datetime.rst:527 +#: ../../library/datetime.rst:530 msgid "" "This is the inverse of :meth:`date.isoformat`. It only supports the format " "``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:535 +#: ../../library/datetime.rst:538 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:545 +#: ../../library/datetime.rst:548 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:550 +#: ../../library/datetime.rst:553 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:555 +#: ../../library/datetime.rst:558 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:563 ../../library/datetime.rst:1072 +#: ../../library/datetime.rst:566 ../../library/datetime.rst:1075 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:568 ../../library/datetime.rst:1077 +#: ../../library/datetime.rst:571 ../../library/datetime.rst:1080 msgid "Between 1 and 12 inclusive." msgstr "" -#: ../../library/datetime.rst:573 ../../library/datetime.rst:1082 +#: ../../library/datetime.rst:576 ../../library/datetime.rst:1085 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:581 +#: ../../library/datetime.rst:584 msgid "``date2 = date1 + timedelta``" msgstr "" -#: ../../library/datetime.rst:581 +#: ../../library/datetime.rst:584 msgid "*date2* is ``timedelta.days`` days removed from *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:584 +#: ../../library/datetime.rst:587 msgid "``date2 = date1 - timedelta``" msgstr "" -#: ../../library/datetime.rst:584 +#: ../../library/datetime.rst:587 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:587 +#: ../../library/datetime.rst:590 msgid "``timedelta = date1 - date2``" msgstr "" -#: ../../library/datetime.rst:587 ../../library/datetime.rst:1130 +#: ../../library/datetime.rst:590 ../../library/datetime.rst:1133 msgid "\\(3)" msgstr "" -#: ../../library/datetime.rst:589 +#: ../../library/datetime.rst:592 msgid "``date1 < date2``" msgstr "" -#: ../../library/datetime.rst:589 +#: ../../library/datetime.rst:592 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:599 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -843,17 +851,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:603 +#: ../../library/datetime.rst:606 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "" -#: ../../library/datetime.rst:606 +#: ../../library/datetime.rst:609 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:610 +#: ../../library/datetime.rst:613 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -866,74 +874,74 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:620 +#: ../../library/datetime.rst:623 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:626 +#: ../../library/datetime.rst:629 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:629 ../../library/datetime.rst:1826 +#: ../../library/datetime.rst:632 ../../library/datetime.rst:1829 msgid "Example::" msgstr "" -#: ../../library/datetime.rst:639 ../../library/datetime.rst:1308 +#: ../../library/datetime.rst:642 ../../library/datetime.rst:1311 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" -#: ../../library/datetime.rst:641 +#: ../../library/datetime.rst:644 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:643 ../../library/datetime.rst:1310 +#: ../../library/datetime.rst:646 ../../library/datetime.rst:1313 msgid "``d.timetuple()`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:647 +#: ../../library/datetime.rst:650 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st." msgstr "" -#: ../../library/datetime.rst:653 +#: ../../library/datetime.rst:656 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:660 +#: ../../library/datetime.rst:663 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" "meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:667 +#: ../../library/datetime.rst:670 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:674 +#: ../../library/datetime.rst:677 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:677 +#: ../../library/datetime.rst:680 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:679 +#: ../../library/datetime.rst:682 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -942,45 +950,45 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:684 +#: ../../library/datetime.rst:687 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:693 +#: ../../library/datetime.rst:696 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:698 +#: ../../library/datetime.rst:701 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" -#: ../../library/datetime.rst:704 +#: ../../library/datetime.rst:707 msgid "This is the inverse of :meth:`date.fromisoformat`." msgstr "" -#: ../../library/datetime.rst:708 +#: ../../library/datetime.rst:711 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:713 +#: ../../library/datetime.rst:716 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:719 ../../library/datetime.rst:1494 +#: ../../library/datetime.rst:722 ../../library/datetime.rst:1497 msgid "``d.ctime()`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:723 +#: ../../library/datetime.rst:726 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:730 +#: ../../library/datetime.rst:733 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -988,7 +996,7 @@ msgid "" "strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:738 +#: ../../library/datetime.rst:741 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals `__." msgstr "" -#: ../../library/datetime.rst:1006 ../../library/datetime.rst:1423 -#: ../../library/datetime.rst:1770 +#: ../../library/datetime.rst:1009 ../../library/datetime.rst:1426 +#: ../../library/datetime.rst:1773 msgid "Examples::" msgstr "" -#: ../../library/datetime.rst:1025 +#: ../../library/datetime.rst:1028 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1284,17 +1292,17 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1034 +#: ../../library/datetime.rst:1037 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1037 +#: ../../library/datetime.rst:1040 msgid "This is equivalent to::" msgstr "" -#: ../../library/datetime.rst:1041 +#: ../../library/datetime.rst:1044 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " "by :func:`time.strptime` or if it returns a value which isn't a time tuple. " @@ -1302,44 +1310,44 @@ msgid "" "behavior`." msgstr "" -#: ../../library/datetime.rst:1052 +#: ../../library/datetime.rst:1055 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1058 +#: ../../library/datetime.rst:1061 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1064 +#: ../../library/datetime.rst:1067 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1087 ../../library/datetime.rst:1690 +#: ../../library/datetime.rst:1090 ../../library/datetime.rst:1693 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1092 ../../library/datetime.rst:1097 -#: ../../library/datetime.rst:1695 ../../library/datetime.rst:1700 +#: ../../library/datetime.rst:1095 ../../library/datetime.rst:1100 +#: ../../library/datetime.rst:1698 ../../library/datetime.rst:1703 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1102 ../../library/datetime.rst:1705 +#: ../../library/datetime.rst:1105 ../../library/datetime.rst:1708 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1107 +#: ../../library/datetime.rst:1110 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1113 ../../library/datetime.rst:1716 +#: ../../library/datetime.rst:1116 ../../library/datetime.rst:1719 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1348,38 +1356,38 @@ msgid "" "(later) of the two moments with the same wall time representation." msgstr "" -#: ../../library/datetime.rst:1126 +#: ../../library/datetime.rst:1129 msgid "``datetime2 = datetime1 + timedelta``" msgstr "" -#: ../../library/datetime.rst:1126 ../../library/datetime.rst:2308 -#: ../../library/datetime.rst:2313 ../../library/datetime.rst:2325 -#: ../../library/datetime.rst:2330 ../../library/datetime.rst:2390 -#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:1129 ../../library/datetime.rst:2310 +#: ../../library/datetime.rst:2315 ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2332 ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2401 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1128 +#: ../../library/datetime.rst:1131 msgid "``datetime2 = datetime1 - timedelta``" msgstr "" -#: ../../library/datetime.rst:1128 ../../library/datetime.rst:2341 +#: ../../library/datetime.rst:1131 ../../library/datetime.rst:2343 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1130 +#: ../../library/datetime.rst:1133 msgid "``timedelta = datetime1 - datetime2``" msgstr "" -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1135 msgid "``datetime1 < datetime2``" msgstr "" -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1135 msgid "Compares :class:`.datetime` to :class:`.datetime`. (4)" msgstr "" -#: ../../library/datetime.rst:1137 +#: ../../library/datetime.rst:1140 msgid "" "datetime2 is a duration of timedelta removed from datetime1, moving forward " "in time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. " @@ -1390,7 +1398,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1146 +#: ../../library/datetime.rst:1149 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1398,14 +1406,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1151 +#: ../../library/datetime.rst:1154 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1155 +#: ../../library/datetime.rst:1158 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1413,7 +1421,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1160 +#: ../../library/datetime.rst:1163 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1422,20 +1430,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1166 +#: ../../library/datetime.rst:1169 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1169 +#: ../../library/datetime.rst:1172 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1173 +#: ../../library/datetime.rst:1176 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1445,13 +1453,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1179 +#: ../../library/datetime.rst:1182 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1185 +#: ../../library/datetime.rst:1188 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1464,27 +1472,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1199 +#: ../../library/datetime.rst:1202 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:1207 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1207 ../../library/datetime.rst:1216 +#: ../../library/datetime.rst:1210 ../../library/datetime.rst:1219 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1213 +#: ../../library/datetime.rst:1216 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1224 +#: ../../library/datetime.rst:1227 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1492,21 +1500,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1235 +#: ../../library/datetime.rst:1238 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1239 +#: ../../library/datetime.rst:1242 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1243 +#: ../../library/datetime.rst:1246 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1514,7 +1522,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1248 +#: ../../library/datetime.rst:1251 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1523,7 +1531,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1254 +#: ../../library/datetime.rst:1257 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1531,56 +1539,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1259 +#: ../../library/datetime.rst:1262 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1271 +#: ../../library/datetime.rst:1274 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1274 +#: ../../library/datetime.rst:1277 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1281 +#: ../../library/datetime.rst:1284 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1285 ../../library/datetime.rst:1868 -#: ../../library/datetime.rst:1974 ../../library/datetime.rst:2220 -#: ../../library/datetime.rst:2232 ../../library/datetime.rst:2529 +#: ../../library/datetime.rst:1288 ../../library/datetime.rst:1871 +#: ../../library/datetime.rst:1977 ../../library/datetime.rst:2222 +#: ../../library/datetime.rst:2234 ../../library/datetime.rst:2531 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1291 +#: ../../library/datetime.rst:1294 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1295 ../../library/datetime.rst:1878 -#: ../../library/datetime.rst:2028 +#: ../../library/datetime.rst:1298 ../../library/datetime.rst:1881 +#: ../../library/datetime.rst:2031 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1301 +#: ../../library/datetime.rst:1304 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1316 +#: ../../library/datetime.rst:1319 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1590,14 +1598,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1327 +#: ../../library/datetime.rst:1330 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1331 +#: ../../library/datetime.rst:1334 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1606,7 +1614,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1340 +#: ../../library/datetime.rst:1343 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1616,20 +1624,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1349 +#: ../../library/datetime.rst:1352 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1354 +#: ../../library/datetime.rst:1357 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1358 +#: ../../library/datetime.rst:1361 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1638,18 +1646,18 @@ msgid "" "`OverflowError` for times far in the past or far in the future." msgstr "" -#: ../../library/datetime.rst:1365 +#: ../../library/datetime.rst:1368 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1372 +#: ../../library/datetime.rst:1375 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1378 +#: ../../library/datetime.rst:1381 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1657,145 +1665,145 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1386 +#: ../../library/datetime.rst:1389 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1392 +#: ../../library/datetime.rst:1395 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1398 +#: ../../library/datetime.rst:1401 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1405 +#: ../../library/datetime.rst:1408 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1411 +#: ../../library/datetime.rst:1414 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1413 +#: ../../library/datetime.rst:1416 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1414 +#: ../../library/datetime.rst:1417 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1416 +#: ../../library/datetime.rst:1419 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" -#: ../../library/datetime.rst:1419 +#: ../../library/datetime.rst:1422 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" msgstr "" -#: ../../library/datetime.rst:1421 +#: ../../library/datetime.rst:1424 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1431 +#: ../../library/datetime.rst:1434 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1445 ../../library/datetime.rst:1806 +#: ../../library/datetime.rst:1448 ../../library/datetime.rst:1809 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1449 ../../library/datetime.rst:1810 +#: ../../library/datetime.rst:1452 ../../library/datetime.rst:1813 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1451 ../../library/datetime.rst:1812 +#: ../../library/datetime.rst:1454 ../../library/datetime.rst:1815 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1452 ../../library/datetime.rst:1813 +#: ../../library/datetime.rst:1455 ../../library/datetime.rst:1816 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1453 ../../library/datetime.rst:1814 +#: ../../library/datetime.rst:1456 ../../library/datetime.rst:1817 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1455 ../../library/datetime.rst:1816 +#: ../../library/datetime.rst:1458 ../../library/datetime.rst:1819 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1457 ../../library/datetime.rst:1818 +#: ../../library/datetime.rst:1460 ../../library/datetime.rst:1821 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1461 ../../library/datetime.rst:1822 +#: ../../library/datetime.rst:1464 ../../library/datetime.rst:1825 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1463 +#: ../../library/datetime.rst:1466 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1840 msgid "Added the *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1479 +#: ../../library/datetime.rst:1482 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1485 +#: ../../library/datetime.rst:1488 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1491 +#: ../../library/datetime.rst:1494 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1498 +#: ../../library/datetime.rst:1501 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1504 +#: ../../library/datetime.rst:1507 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. For a complete list of formatting directives, see :ref:" "`strftime-strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:1511 +#: ../../library/datetime.rst:1514 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1803,70 +1811,70 @@ msgid "" "of formatting directives, see :ref:`strftime-strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:1518 +#: ../../library/datetime.rst:1521 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1520 +#: ../../library/datetime.rst:1523 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1573 +#: ../../library/datetime.rst:1576 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1620 +#: ../../library/datetime.rst:1623 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1646 +#: ../../library/datetime.rst:1649 msgid ":class:`.time` Objects" msgstr "" -#: ../../library/datetime.rst:1648 +#: ../../library/datetime.rst:1651 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1653 +#: ../../library/datetime.rst:1656 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1663 +#: ../../library/datetime.rst:1666 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:1674 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1676 +#: ../../library/datetime.rst:1679 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1681 +#: ../../library/datetime.rst:1684 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1710 +#: ../../library/datetime.rst:1713 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1724 +#: ../../library/datetime.rst:1727 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1875,7 +1883,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1730 +#: ../../library/datetime.rst:1733 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1889,18 +1897,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1740 +#: ../../library/datetime.rst:1743 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1744 +#: ../../library/datetime.rst:1747 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1746 +#: ../../library/datetime.rst:1749 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1908,24 +1916,24 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1753 +#: ../../library/datetime.rst:1756 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1757 +#: ../../library/datetime.rst:1760 msgid "" "Return a :class:`.time` corresponding to a *time_string* in one of the " "formats emitted by :meth:`time.isoformat`. Specifically, this function " "supports strings in the format:" msgstr "" -#: ../../library/datetime.rst:1767 +#: ../../library/datetime.rst:1770 msgid "" "This does *not* support parsing arbitrary ISO 8601 strings. It is only " "intended as the inverse operation of :meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1788 +#: ../../library/datetime.rst:1791 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1933,46 +1941,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1799 +#: ../../library/datetime.rst:1802 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1801 +#: ../../library/datetime.rst:1804 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1802 +#: ../../library/datetime.rst:1805 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1803 +#: ../../library/datetime.rst:1806 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1804 +#: ../../library/datetime.rst:1807 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1824 +#: ../../library/datetime.rst:1827 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1846 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:1851 msgid "" "Return a string representing the time, controlled by an explicit format " "string. For a complete list of formatting directives, see :ref:`strftime-" "strptime-behavior`." msgstr "" -#: ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:1858 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2111 +#: ../../library/datetime.rst:2114 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2239,7 +2247,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2125 +#: ../../library/datetime.rst:2128 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2248,7 +2256,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2144 +#: ../../library/datetime.rst:2147 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2263,13 +2271,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2166 +#: ../../library/datetime.rst:2169 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2169 +#: ../../library/datetime.rst:2172 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2279,28 +2287,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2184 -msgid "`dateutil.tz `_" +#: ../../library/datetime.rst:2186 +msgid ":mod:`zoneinfo`" msgstr "" -#: ../../library/datetime.rst:2178 +#: ../../library/datetime.rst:2181 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2182 +#: ../../library/datetime.rst:2185 msgid "" -"*dateutil.tz* library brings the *IANA timezone database* (also known as the " -"Olson database) to Python, and its usage is recommended." +"``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " +"database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2190 +#: ../../library/datetime.rst:2192 msgid "`IANA timezone database `_" msgstr "" -#: ../../library/datetime.rst:2187 +#: ../../library/datetime.rst:2189 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2309,24 +2317,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2199 msgid ":class:`timezone` Objects" msgstr "" -#: ../../library/datetime.rst:2199 +#: ../../library/datetime.rst:2201 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2203 +#: ../../library/datetime.rst:2205 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2210 +#: ../../library/datetime.rst:2212 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2334,25 +2342,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2215 +#: ../../library/datetime.rst:2217 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2226 ../../library/datetime.rst:2237 +#: ../../library/datetime.rst:2228 ../../library/datetime.rst:2239 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2231 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2240 +#: ../../library/datetime.rst:2242 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2361,138 +2369,138 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2246 +#: ../../library/datetime.rst:2248 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain `'UTC'`, not ``'UTC" "+00:00'``." msgstr "" -#: ../../library/datetime.rst:2253 +#: ../../library/datetime.rst:2255 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2257 +#: ../../library/datetime.rst:2259 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2264 +#: ../../library/datetime.rst:2266 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2273 +#: ../../library/datetime.rst:2275 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr "" -#: ../../library/datetime.rst:2275 +#: ../../library/datetime.rst:2277 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2279 +#: ../../library/datetime.rst:2281 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2285 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2289 msgid "``strftime``" msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2289 msgid "``strptime``" msgstr "" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2291 msgid "Usage" msgstr "" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2291 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2291 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2293 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2293 msgid "Instance method" msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2293 msgid "Class method" msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2295 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2295 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2295 msgid ":class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:2295 +#: ../../library/datetime.rst:2297 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2295 +#: ../../library/datetime.rst:2297 msgid "``strftime(format)``" msgstr "" -#: ../../library/datetime.rst:2295 +#: ../../library/datetime.rst:2297 msgid "``strptime(date_string, format)``" msgstr "" -#: ../../library/datetime.rst:2300 +#: ../../library/datetime.rst:2302 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2302 +#: ../../library/datetime.rst:2304 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Example" msgstr "" -#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2308 ../../library/datetime.rst:2411 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2310 msgid "``%a``" msgstr "" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2310 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2504,11 +2512,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2315 msgid "``%A``" msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2315 msgid "Weekday as locale's full name." msgstr "" @@ -2520,42 +2528,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2318 +#: ../../library/datetime.rst:2320 msgid "``%w``" msgstr "" -#: ../../library/datetime.rst:2318 +#: ../../library/datetime.rst:2320 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2318 +#: ../../library/datetime.rst:2320 msgid "0, 1, ..., 6" msgstr "" -#: ../../library/datetime.rst:2322 +#: ../../library/datetime.rst:2324 msgid "``%d``" msgstr "" -#: ../../library/datetime.rst:2322 +#: ../../library/datetime.rst:2324 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2322 +#: ../../library/datetime.rst:2324 msgid "01, 02, ..., 31" msgstr "" -#: ../../library/datetime.rst:2322 ../../library/datetime.rst:2335 -#: ../../library/datetime.rst:2338 ../../library/datetime.rst:2344 -#: ../../library/datetime.rst:2347 ../../library/datetime.rst:2353 -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2324 ../../library/datetime.rst:2337 +#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2349 ../../library/datetime.rst:2355 +#: ../../library/datetime.rst:2373 msgid "\\(9)" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2327 msgid "``%b``" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2327 msgid "Month as locale's abbreviated name." msgstr "" @@ -2567,11 +2575,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2330 +#: ../../library/datetime.rst:2332 msgid "``%B``" msgstr "" -#: ../../library/datetime.rst:2330 +#: ../../library/datetime.rst:2332 msgid "Month as locale's full name." msgstr "" @@ -2583,67 +2591,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2335 +#: ../../library/datetime.rst:2337 msgid "``%m``" msgstr "" -#: ../../library/datetime.rst:2335 +#: ../../library/datetime.rst:2337 msgid "Month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2335 ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2337 ../../library/datetime.rst:2349 msgid "01, 02, ..., 12" msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2340 msgid "``%y``" msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2340 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2340 msgid "00, 01, ..., 99" msgstr "" -#: ../../library/datetime.rst:2341 +#: ../../library/datetime.rst:2343 msgid "``%Y``" msgstr "" -#: ../../library/datetime.rst:2341 +#: ../../library/datetime.rst:2343 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2341 ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2343 ../../library/datetime.rst:2413 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2346 msgid "``%H``" msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2346 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2346 msgid "00, 01, ..., 23" msgstr "" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2349 msgid "``%I``" msgstr "" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2349 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2352 msgid "``%p``" msgstr "" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2352 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2655,127 +2663,127 @@ msgstr "" msgid "am, pm (de_DE)" msgstr "" -#: ../../library/datetime.rst:2350 +#: ../../library/datetime.rst:2352 msgid "\\(1), \\(3)" msgstr "" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2355 msgid "``%M``" msgstr "" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2355 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2353 ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2355 ../../library/datetime.rst:2358 msgid "00, 01, ..., 59" msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2358 msgid "``%S``" msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2358 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2358 msgid "\\(4), \\(9)" msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "``%f``" msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "Microsecond as a decimal number, zero-padded on the left." msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "000000, 000001, ..., 999999" msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "\\(5)" msgstr "" -#: ../../library/datetime.rst:2363 ../../library/datetime.rst:2527 +#: ../../library/datetime.rst:2365 ../../library/datetime.rst:2529 msgid "``%z``" msgstr "" -#: ../../library/datetime.rst:2363 +#: ../../library/datetime.rst:2365 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2363 +#: ../../library/datetime.rst:2365 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2363 ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2365 ../../library/datetime.rst:2370 msgid "\\(6)" msgstr "" -#: ../../library/datetime.rst:2368 ../../library/datetime.rst:2551 +#: ../../library/datetime.rst:2370 ../../library/datetime.rst:2553 msgid "``%Z``" msgstr "" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2370 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2370 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "``%j``" msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "001, 002, ..., 366" msgstr "" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2376 msgid "``%U``" msgstr "" -#: ../../library/datetime.rst:2374 +#: ../../library/datetime.rst:2376 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero " "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2376 ../../library/datetime.rst:2384 msgid "00, 01, ..., 53" msgstr "" -#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2376 ../../library/datetime.rst:2384 msgid "\\(7), \\(9)" msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2384 msgid "``%W``" msgstr "" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2384 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number. All days in a new year preceding the first Monday are considered to " "be in week 0." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2392 msgid "``%c``" msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2392 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2787,11 +2795,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2397 msgid "``%x``" msgstr "" -#: ../../library/datetime.rst:2395 +#: ../../library/datetime.rst:2397 msgid "Locale's appropriate date representation." msgstr "" @@ -2807,11 +2815,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2401 msgid "``%X``" msgstr "" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2401 msgid "Locale's appropriate time representation." msgstr "" @@ -2823,69 +2831,69 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "``%%``" msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "%" msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2407 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2413 msgid "``%G``" msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2413 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2413 msgid "\\(8)" msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2418 msgid "``%u``" msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2418 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2418 msgid "1, 2, ..., 7" msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "``%V``" msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "01, 02, ..., 53" msgstr "" -#: ../../library/datetime.rst:2419 +#: ../../library/datetime.rst:2421 msgid "\\(8), \\(9)" msgstr "" -#: ../../library/datetime.rst:2426 +#: ../../library/datetime.rst:2428 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2894,7 +2902,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2431 +#: ../../library/datetime.rst:2433 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -2904,40 +2912,40 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2439 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2443 msgid "Technical Detail" msgstr "" -#: ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2445 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2447 +#: ../../library/datetime.rst:2449 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2453 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2457 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2461 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`time` objects have no such values. If they're used " @@ -2945,14 +2953,14 @@ msgid "" "day." msgstr "" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2465 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, ``0`` is substituted for them." msgstr "" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2469 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -2961,7 +2969,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2478 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -2972,37 +2980,37 @@ msgid "" "to determine the current locale's encoding)." msgstr "" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2487 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2488 +#: ../../library/datetime.rst:2490 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2492 +#: ../../library/datetime.rst:2494 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2499 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2503 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2507 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3010,17 +3018,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:2514 msgid "" "For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty " "strings." msgstr "" -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:2517 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2520 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3034,7 +3042,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:2534 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3042,47 +3050,47 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2542 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2546 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2548 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2547 +#: ../../library/datetime.rst:2549 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2549 +#: ../../library/datetime.rst:2551 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2555 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2559 +#: ../../library/datetime.rst:2561 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2566 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3090,22 +3098,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2572 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%J``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2575 +#: ../../library/datetime.rst:2577 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:2578 msgid "If, that is, we ignore the effects of Relativity" msgstr "" -#: ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:2580 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3114,14 +3122,14 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2584 +#: ../../library/datetime.rst:2586 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a " "good explanation." msgstr "" -#: ../../library/datetime.rst:2588 +#: ../../library/datetime.rst:2590 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." diff --git a/library/enum.po b/library/enum.po index e31d966819..c16acac0bb 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-22 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -984,9 +984,10 @@ msgstr "" #: ../../library/enum.rst:1128 msgid "" -"Private names will be normal attributes in Python 3.10 instead of either an " -"error or a member (depending on if the name ends with an underscore). Using " -"these names in 3.9 will issue a :exc:`DeprecationWarning`." +":ref:`Private names ` will be normal attributes in " +"Python 3.11 instead of either an error or a member (depending on if the name " +"ends with an underscore). Using these names in 3.9 and 3.10 will issue a :" +"exc:`DeprecationWarning`." msgstr "" #: ../../library/enum.rst:1134 @@ -1003,11 +1004,15 @@ msgid "" "uppercase names for members)::" msgstr "" -#: ../../library/enum.rst:1157 +#: ../../library/enum.rst:1155 +msgid "This behavior is deprecated and will be removed in 3.12." +msgstr "" + +#: ../../library/enum.rst:1161 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../library/enum.rst:1159 +#: ../../library/enum.rst:1163 msgid "" ":class:`Enum` members that are mixed with non-:class:`Enum` types (such as :" "class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in " @@ -1016,27 +1021,34 @@ msgid "" "to your class::" msgstr "" -#: ../../library/enum.rst:1168 +#: ../../library/enum.rst:1172 msgid ":class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../library/enum.rst:1172 +#: ../../library/enum.rst:1176 msgid "``Enum`` classes with methods" msgstr "" -#: ../../library/enum.rst:1174 +#: ../../library/enum.rst:1178 msgid "" "If you give your :class:`Enum` subclass extra methods, like the `Planet`_ " "class above, those methods will show up in a :func:`dir` of the member, but " "not of the class::" msgstr "" -#: ../../library/enum.rst:1185 +#: ../../library/enum.rst:1189 msgid "Combining members of ``Flag``" msgstr "" -#: ../../library/enum.rst:1187 +#: ../../library/enum.rst:1191 msgid "" "If a combination of Flag members is not named, the :func:`repr` will include " "all named flags and all named combinations of flags that are in the value::" msgstr "" + +#: ../../library/enum.rst:1209 +msgid "" +"In 3.11 unnamed combinations of flags will only produce the canonical flag " +"members (aka single-value flags). So ``Color(7)`` would produce something " +"like ````." +msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index 434e9163b4..c3ab11cb7c 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-21 00:12+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,7 +61,11 @@ msgid "" "the Python Tutorial under :ref:`tut-userexceptions`." msgstr "" -#: ../../library/exceptions.rst:37 +#: ../../library/exceptions.rst:39 +msgid "Exception context" +msgstr "" + +#: ../../library/exceptions.rst:41 msgid "" "When raising (or re-raising) an exception in an :keyword:`except` or :" "keyword:`finally` clause :attr:`__context__` is automatically set to the " @@ -70,7 +74,7 @@ msgid "" "the final exception." msgstr "" -#: ../../library/exceptions.rst:43 +#: ../../library/exceptions.rst:47 msgid "" "When raising a new exception (rather than using a bare ``raise`` to re-raise " "the exception currently being handled), the implicit exception context can " @@ -78,7 +82,7 @@ msgid "" "keyword:`raise`::" msgstr "" -#: ../../library/exceptions.rst:50 +#: ../../library/exceptions.rst:54 msgid "" "The expression following :keyword:`from` must be an exception or " "``None``. It will be set as :attr:`__cause__` on the raised exception. " @@ -90,7 +94,7 @@ msgid "" "introspection when debugging." msgstr "" -#: ../../library/exceptions.rst:59 +#: ../../library/exceptions.rst:63 msgid "" "The default traceback display code shows these chained exceptions in " "addition to the traceback for the exception itself. An explicitly chained " @@ -99,24 +103,46 @@ msgid "" "is :const:`None` and :attr:`__suppress_context__` is false." msgstr "" -#: ../../library/exceptions.rst:65 +#: ../../library/exceptions.rst:69 msgid "" "In either case, the exception itself is always shown after any chained " "exceptions so that the final line of the traceback always shows the last " "exception that was raised." msgstr "" -#: ../../library/exceptions.rst:71 +#: ../../library/exceptions.rst:75 +msgid "Inheriting from built-in exceptions" +msgstr "繼承自內建的例外" + +#: ../../library/exceptions.rst:77 +msgid "" +"User code can create subclasses that inherit from an exception type. It's " +"recommended to only subclass one exception type at a time to avoid any " +"possible conflicts between how the bases handle the ``args`` attribute, as " +"well as due to possible memory layout incompatibilities." +msgstr "" + +#: ../../library/exceptions.rst:84 +msgid "" +"Most built-in exceptions are implemented in C for efficiency, see: :source:" +"`Objects/exceptions.c`. Some have custom memory layouts which makes it " +"impossible to create a subclass that inherits from multiple exception types. " +"The memory layout of a type is an implementation detail and might change " +"between Python versions, leading to new conflicts in the future. Therefore, " +"it's recommended to avoid subclassing multiple exception types altogether." +msgstr "" + +#: ../../library/exceptions.rst:94 msgid "Base classes" msgstr "" -#: ../../library/exceptions.rst:73 +#: ../../library/exceptions.rst:96 msgid "" "The following exceptions are used mostly as base classes for other " "exceptions." msgstr "" -#: ../../library/exceptions.rst:77 +#: ../../library/exceptions.rst:100 msgid "" "The base class for all built-in exceptions. It is not meant to be directly " "inherited by user-defined classes (for that, use :exc:`Exception`). If :" @@ -125,7 +151,7 @@ msgid "" "were no arguments." msgstr "" -#: ../../library/exceptions.rst:85 +#: ../../library/exceptions.rst:108 msgid "" "The tuple of arguments given to the exception constructor. Some built-in " "exceptions (like :exc:`OSError`) expect a certain number of arguments and " @@ -133,69 +159,69 @@ msgid "" "usually called only with a single string giving an error message." msgstr "" -#: ../../library/exceptions.rst:92 +#: ../../library/exceptions.rst:115 msgid "" "This method sets *tb* as the new traceback for the exception and returns the " "exception object. It is usually used in exception handling code like this::" msgstr "" -#: ../../library/exceptions.rst:105 +#: ../../library/exceptions.rst:128 msgid "" "All built-in, non-system-exiting exceptions are derived from this class. " "All user-defined exceptions should also be derived from this class." msgstr "" -#: ../../library/exceptions.rst:111 +#: ../../library/exceptions.rst:134 msgid "" "The base class for those built-in exceptions that are raised for various " "arithmetic errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" "`FloatingPointError`." msgstr "" -#: ../../library/exceptions.rst:118 +#: ../../library/exceptions.rst:141 msgid "" "Raised when a :ref:`buffer ` related operation cannot be " "performed." msgstr "" -#: ../../library/exceptions.rst:124 +#: ../../library/exceptions.rst:147 msgid "" "The base class for the exceptions that are raised when a key or index used " "on a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. " "This can be raised directly by :func:`codecs.lookup`." msgstr "" -#: ../../library/exceptions.rst:130 +#: ../../library/exceptions.rst:153 msgid "Concrete exceptions" msgstr "" -#: ../../library/exceptions.rst:132 +#: ../../library/exceptions.rst:155 msgid "The following exceptions are the exceptions that are usually raised." msgstr "" -#: ../../library/exceptions.rst:138 +#: ../../library/exceptions.rst:161 msgid "Raised when an :keyword:`assert` statement fails." msgstr "" -#: ../../library/exceptions.rst:143 +#: ../../library/exceptions.rst:166 msgid "" "Raised when an attribute reference (see :ref:`attribute-references`) or " "assignment fails. (When an object does not support attribute references or " "attribute assignments at all, :exc:`TypeError` is raised.)" msgstr "" -#: ../../library/exceptions.rst:150 +#: ../../library/exceptions.rst:173 msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " "without reading any data. (N.B.: the :meth:`io.IOBase.read` and :meth:`io." "IOBase.readline` methods return an empty string when they hit EOF.)" msgstr "" -#: ../../library/exceptions.rst:157 +#: ../../library/exceptions.rst:180 msgid "Not currently used." msgstr "" -#: ../../library/exceptions.rst:162 +#: ../../library/exceptions.rst:185 msgid "" "Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:" "`generator.close` and :meth:`coroutine.close`. It directly inherits from :" @@ -203,14 +229,14 @@ msgid "" "an error." msgstr "" -#: ../../library/exceptions.rst:170 +#: ../../library/exceptions.rst:193 msgid "" "Raised when the :keyword:`import` statement has troubles trying to load a " "module. Also raised when the \"from list\" in ``from ... import`` has a " "name that cannot be found." msgstr "" -#: ../../library/exceptions.rst:174 +#: ../../library/exceptions.rst:197 msgid "" "The :attr:`name` and :attr:`path` attributes can be set using keyword-only " "arguments to the constructor. When set they represent the name of the module " @@ -218,31 +244,31 @@ msgid "" "the exception, respectively." msgstr "" -#: ../../library/exceptions.rst:179 +#: ../../library/exceptions.rst:202 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "" -#: ../../library/exceptions.rst:184 +#: ../../library/exceptions.rst:207 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" "data:`sys.modules`." msgstr "" -#: ../../library/exceptions.rst:193 +#: ../../library/exceptions.rst:216 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " "integer, :exc:`TypeError` is raised.)" msgstr "" -#: ../../library/exceptions.rst:202 +#: ../../library/exceptions.rst:225 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." msgstr "" -#: ../../library/exceptions.rst:209 +#: ../../library/exceptions.rst:232 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -251,7 +277,7 @@ msgid "" "the interpreter from exiting." msgstr "" -#: ../../library/exceptions.rst:218 +#: ../../library/exceptions.rst:241 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -262,14 +288,14 @@ msgid "" "stack traceback can be printed, in case a run-away program was the cause." msgstr "" -#: ../../library/exceptions.rst:229 +#: ../../library/exceptions.rst:252 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " "the name that could not be found." msgstr "" -#: ../../library/exceptions.rst:236 +#: ../../library/exceptions.rst:259 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -277,28 +303,28 @@ msgid "" "developed to indicate that the real implementation still needs to be added." msgstr "" -#: ../../library/exceptions.rst:243 +#: ../../library/exceptions.rst:266 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -#: ../../library/exceptions.rst:249 +#: ../../library/exceptions.rst:272 msgid "" "``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " "though they have similar names and purposes. See :data:`NotImplemented` for " "details on when to use it." msgstr "" -#: ../../library/exceptions.rst:258 +#: ../../library/exceptions.rst:281 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk full" "\" (not for illegal argument types or other incidental errors)." msgstr "" -#: ../../library/exceptions.rst:262 +#: ../../library/exceptions.rst:285 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -307,7 +333,7 @@ msgid "" "constructor arguments." msgstr "" -#: ../../library/exceptions.rst:268 +#: ../../library/exceptions.rst:291 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -316,18 +342,18 @@ msgid "" "subclassing." msgstr "" -#: ../../library/exceptions.rst:276 +#: ../../library/exceptions.rst:299 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "" -#: ../../library/exceptions.rst:280 +#: ../../library/exceptions.rst:303 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" -#: ../../library/exceptions.rst:284 +#: ../../library/exceptions.rst:307 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -335,14 +361,14 @@ msgid "" "ignored, and the :attr:`winerror` attribute does not exist." msgstr "" -#: ../../library/exceptions.rst:292 +#: ../../library/exceptions.rst:315 msgid "" "The corresponding error message, as provided by the operating system. It is " "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" "`FormatMessage` under Windows." msgstr "" -#: ../../library/exceptions.rst:300 +#: ../../library/exceptions.rst:323 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -351,14 +377,14 @@ msgid "" "the function." msgstr "" -#: ../../library/exceptions.rst:307 +#: ../../library/exceptions.rst:330 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" "`OSError`, and the constructor may return a subclass." msgstr "" -#: ../../library/exceptions.rst:313 +#: ../../library/exceptions.rst:336 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the filesystem " @@ -366,7 +392,7 @@ msgid "" "added." msgstr "" -#: ../../library/exceptions.rst:322 +#: ../../library/exceptions.rst:345 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -376,18 +402,18 @@ msgid "" "in C, most floating point operations are not checked." msgstr "" -#: ../../library/exceptions.rst:332 +#: ../../library/exceptions.rst:355 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." "getrecursionlimit`) is exceeded." msgstr "" -#: ../../library/exceptions.rst:336 +#: ../../library/exceptions.rst:359 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/exceptions.rst:342 +#: ../../library/exceptions.rst:365 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -395,65 +421,65 @@ msgid "" "references, see the :mod:`weakref` module." msgstr "" -#: ../../library/exceptions.rst:350 +#: ../../library/exceptions.rst:373 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " "wrong." msgstr "" -#: ../../library/exceptions.rst:357 +#: ../../library/exceptions.rst:380 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " "produced by the iterator." msgstr "" -#: ../../library/exceptions.rst:361 +#: ../../library/exceptions.rst:384 msgid "" "The exception object has a single attribute :attr:`value`, which is given as " "an argument when constructing the exception, and defaults to :const:`None`." msgstr "" -#: ../../library/exceptions.rst:365 +#: ../../library/exceptions.rst:388 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " "is used as the :attr:`value` parameter to the constructor of the exception." msgstr "" -#: ../../library/exceptions.rst:370 +#: ../../library/exceptions.rst:393 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" -#: ../../library/exceptions.rst:374 +#: ../../library/exceptions.rst:397 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "" -#: ../../library/exceptions.rst:378 +#: ../../library/exceptions.rst:401 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" -#: ../../library/exceptions.rst:382 +#: ../../library/exceptions.rst:405 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" -#: ../../library/exceptions.rst:388 +#: ../../library/exceptions.rst:411 msgid "" "Must be raised by :meth:`__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -#: ../../library/exceptions.rst:395 +#: ../../library/exceptions.rst:418 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -461,33 +487,33 @@ msgid "" "or standard input (also interactively)." msgstr "" -#: ../../library/exceptions.rst:401 +#: ../../library/exceptions.rst:424 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." msgstr "" -#: ../../library/exceptions.rst:406 +#: ../../library/exceptions.rst:429 msgid "The name of the file the syntax error occurred in." msgstr "" -#: ../../library/exceptions.rst:410 +#: ../../library/exceptions.rst:433 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:415 +#: ../../library/exceptions.rst:438 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:420 +#: ../../library/exceptions.rst:443 msgid "The source code text involved in the error." msgstr "" -#: ../../library/exceptions.rst:422 +#: ../../library/exceptions.rst:445 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -495,26 +521,26 @@ msgid "" "attribute: ('f-string: ...', ('', 1, 4, '(a b)\\n'))." msgstr "" -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:453 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: ../../library/exceptions.rst:436 +#: ../../library/exceptions.rst:459 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: ../../library/exceptions.rst:442 +#: ../../library/exceptions.rst:465 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " "a string indicating what went wrong (in low-level terms)." msgstr "" -#: ../../library/exceptions.rst:446 +#: ../../library/exceptions.rst:469 msgid "" "You should report this to the author or maintainer of your Python " "interpreter. Be sure to report the version of the Python interpreter (``sys." @@ -523,7 +549,7 @@ msgid "" "possible the source of the program that triggered the error." msgstr "" -#: ../../library/exceptions.rst:455 +#: ../../library/exceptions.rst:478 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -537,7 +563,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:489 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -547,20 +573,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: ../../library/exceptions.rst:475 +#: ../../library/exceptions.rst:498 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: ../../library/exceptions.rst:481 +#: ../../library/exceptions.rst:504 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -#: ../../library/exceptions.rst:484 +#: ../../library/exceptions.rst:507 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -568,7 +594,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:512 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -576,135 +602,135 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:496 +#: ../../library/exceptions.rst:519 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" -#: ../../library/exceptions.rst:503 +#: ../../library/exceptions.rst:526 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:506 +#: ../../library/exceptions.rst:529 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -#: ../../library/exceptions.rst:512 +#: ../../library/exceptions.rst:535 msgid "The name of the encoding that raised the error." msgstr "" -#: ../../library/exceptions.rst:516 +#: ../../library/exceptions.rst:539 msgid "A string describing the specific codec error." msgstr "" -#: ../../library/exceptions.rst:520 +#: ../../library/exceptions.rst:543 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: ../../library/exceptions.rst:524 +#: ../../library/exceptions.rst:547 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:528 +#: ../../library/exceptions.rst:551 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:533 +#: ../../library/exceptions.rst:556 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:539 +#: ../../library/exceptions.rst:562 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:545 +#: ../../library/exceptions.rst:568 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:551 +#: ../../library/exceptions.rst:574 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -#: ../../library/exceptions.rst:558 +#: ../../library/exceptions.rst:581 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -#: ../../library/exceptions.rst:563 +#: ../../library/exceptions.rst:586 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -#: ../../library/exceptions.rst:572 +#: ../../library/exceptions.rst:595 msgid "Only available on Windows." msgstr "" -#: ../../library/exceptions.rst:576 +#: ../../library/exceptions.rst:599 msgid "OS exceptions" msgstr "" -#: ../../library/exceptions.rst:578 +#: ../../library/exceptions.rst:601 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: ../../library/exceptions.rst:583 +#: ../../library/exceptions.rst:606 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` ``EAGAIN``, ``EALREADY``, " "``EWOULDBLOCK`` and ``EINPROGRESS``." msgstr "" -#: ../../library/exceptions.rst:588 +#: ../../library/exceptions.rst:611 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:616 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -#: ../../library/exceptions.rst:599 +#: ../../library/exceptions.rst:622 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` ``ECHILD``." msgstr "" -#: ../../library/exceptions.rst:604 +#: ../../library/exceptions.rst:627 msgid "A base class for connection-related issues." msgstr "" -#: ../../library/exceptions.rst:606 +#: ../../library/exceptions.rst:629 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: ../../library/exceptions.rst:611 +#: ../../library/exceptions.rst:634 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -712,56 +738,56 @@ msgid "" "``ESHUTDOWN``." msgstr "" -#: ../../library/exceptions.rst:618 +#: ../../library/exceptions.rst:641 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` ``ECONNABORTED``." msgstr "" -#: ../../library/exceptions.rst:624 +#: ../../library/exceptions.rst:647 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` ``ECONNREFUSED``." msgstr "" -#: ../../library/exceptions.rst:630 +#: ../../library/exceptions.rst:653 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` ``ECONNRESET``." msgstr "" -#: ../../library/exceptions.rst:636 +#: ../../library/exceptions.rst:659 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` ``EEXIST``." msgstr "" -#: ../../library/exceptions.rst:641 +#: ../../library/exceptions.rst:664 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` ``ENOENT``." msgstr "" -#: ../../library/exceptions.rst:646 +#: ../../library/exceptions.rst:669 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:data:`~errno.EINTR`." msgstr "" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:672 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: ../../library/exceptions.rst:656 +#: ../../library/exceptions.rst:679 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` ``EISDIR``." msgstr "" -#: ../../library/exceptions.rst:662 +#: ../../library/exceptions.rst:685 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -769,123 +795,123 @@ msgid "" "as if it were a directory. Corresponds to :c:data:`errno` ``ENOTDIR``." msgstr "" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:693 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` " "``EACCES`` and ``EPERM``." msgstr "" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:699 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` " "``ESRCH``." msgstr "" -#: ../../library/exceptions.rst:681 +#: ../../library/exceptions.rst:704 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` ``ETIMEDOUT``." msgstr "" -#: ../../library/exceptions.rst:684 +#: ../../library/exceptions.rst:707 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: ../../library/exceptions.rst:690 +#: ../../library/exceptions.rst:713 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:696 +#: ../../library/exceptions.rst:719 msgid "Warnings" msgstr "" -#: ../../library/exceptions.rst:698 +#: ../../library/exceptions.rst:721 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: ../../library/exceptions.rst:703 +#: ../../library/exceptions.rst:726 msgid "Base class for warning categories." msgstr "" -#: ../../library/exceptions.rst:708 +#: ../../library/exceptions.rst:731 msgid "Base class for warnings generated by user code." msgstr "" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:736 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: ../../library/exceptions.rst:716 +#: ../../library/exceptions.rst:739 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " "warning." msgstr "" -#: ../../library/exceptions.rst:720 ../../library/exceptions.rst:736 +#: ../../library/exceptions.rst:743 ../../library/exceptions.rst:759 msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../library/exceptions.rst:725 +#: ../../library/exceptions.rst:748 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -#: ../../library/exceptions.rst:729 +#: ../../library/exceptions.rst:752 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -#: ../../library/exceptions.rst:733 ../../library/exceptions.rst:759 -#: ../../library/exceptions.rst:777 +#: ../../library/exceptions.rst:756 ../../library/exceptions.rst:782 +#: ../../library/exceptions.rst:800 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: ../../library/exceptions.rst:741 +#: ../../library/exceptions.rst:764 msgid "Base class for warnings about dubious syntax." msgstr "" -#: ../../library/exceptions.rst:746 +#: ../../library/exceptions.rst:769 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: ../../library/exceptions.rst:751 +#: ../../library/exceptions.rst:774 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -#: ../../library/exceptions.rst:757 +#: ../../library/exceptions.rst:780 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: ../../library/exceptions.rst:765 +#: ../../library/exceptions.rst:788 msgid "Base class for warnings related to Unicode." msgstr "" -#: ../../library/exceptions.rst:770 +#: ../../library/exceptions.rst:793 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/exceptions.rst:775 +#: ../../library/exceptions.rst:798 msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:785 +#: ../../library/exceptions.rst:808 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:787 +#: ../../library/exceptions.rst:810 msgid "The class hierarchy for built-in exceptions is:" msgstr "" diff --git a/library/functions.po b/library/functions.po index fbe892253d..4cd099c260 100644 --- a/library/functions.po +++ b/library/functions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-07 00:10+0000\n" +"POT-Creation-Date: 2021-10-22 00:14+0000\n" "PO-Revision-Date: 2018-11-10 18:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2244,10 +2244,13 @@ msgid "" "operands, the result has the same type as the operands (after coercion) " "unless the second argument is negative; in that case, all arguments are " "converted to float and a float result is delivered. For example, ``pow(10, " -"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``." +"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative " +"base of type :class:`int` or :class:`float` and a non-integral exponent, a " +"complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value " +"close to ``3j``." msgstr "" -#: ../../library/functions.rst:1304 +#: ../../library/functions.rst:1307 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2256,29 +2259,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1313 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1317 +#: ../../library/functions.rst:1320 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1322 +#: ../../library/functions.rst:1325 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1329 +#: ../../library/functions.rst:1332 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file* and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1333 +#: ../../library/functions.rst:1336 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2287,7 +2290,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1339 +#: ../../library/functions.rst:1342 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2295,40 +2298,40 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1344 +#: ../../library/functions.rst:1347 msgid "" "Whether output is buffered is usually determined by *file*, but if the " "*flush* keyword argument is true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1350 #, fuzzy msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* keyword 實參。" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1356 #, fuzzy msgid "Return a property attribute." msgstr "返回 property 屬性。" -#: ../../library/functions.rst:1355 +#: ../../library/functions.rst:1358 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1359 +#: ../../library/functions.rst:1362 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1376 +#: ../../library/functions.rst:1379 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1379 +#: ../../library/functions.rst:1382 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2336,14 +2339,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1392 +#: ../../library/functions.rst:1395 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a \"getter" "\" for a read-only attribute with the same name, and it sets the docstring " "for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1399 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2351,30 +2354,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1418 +#: ../../library/functions.rst:1421 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1422 +#: ../../library/functions.rst:1425 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1425 +#: ../../library/functions.rst:1428 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1434 +#: ../../library/functions.rst:1437 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1440 +#: ../../library/functions.rst:1443 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2385,7 +2388,7 @@ msgid "" "function returns for its instances by defining a :meth:`__repr__` method." msgstr "" -#: ../../library/functions.rst:1451 +#: ../../library/functions.rst:1454 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2393,14 +2396,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1459 +#: ../../library/functions.rst:1462 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1466 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2411,13 +2414,13 @@ msgid "" "``None``. Otherwise the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1472 +#: ../../library/functions.rst:1475 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1477 +#: ../../library/functions.rst:1480 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2426,21 +2429,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1488 +#: ../../library/functions.rst:1491 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1495 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1499 +#: ../../library/functions.rst:1502 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string and an arbitrary value. The string may name an existing attribute or " @@ -2449,14 +2452,14 @@ msgid "" "equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1507 +#: ../../library/functions.rst:1510 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1516 +#: ../../library/functions.rst:1519 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2469,35 +2472,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1529 +#: ../../library/functions.rst:1532 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1531 +#: ../../library/functions.rst:1534 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1533 +#: ../../library/functions.rst:1536 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1537 +#: ../../library/functions.rst:1540 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1540 +#: ../../library/functions.rst:1543 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1543 +#: ../../library/functions.rst:1546 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2505,7 +2508,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1548 +#: ../../library/functions.rst:1551 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2517,22 +2520,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1557 +#: ../../library/functions.rst:1560 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1561 +#: ../../library/functions.rst:1564 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1563 +#: ../../library/functions.rst:1566 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1570 +#: ../../library/functions.rst:1573 #, fuzzy msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" @@ -2541,20 +2544,20 @@ msgstr "" "``@classmethod`` 形式是一個函式 :term:`decorator` - 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" -#: ../../library/functions.rst:1573 +#: ../../library/functions.rst:1576 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``)." msgstr "" -#: ../../library/functions.rst:1576 +#: ../../library/functions.rst:1579 msgid "" "Static methods in Python are similar to those found in Java or C++. Also " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1580 +#: ../../library/functions.rst:1583 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2563,30 +2566,30 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1589 +#: ../../library/functions.rst:1592 #, fuzzy msgid "For more information on static methods, see :ref:`types`." msgstr "關於類方法的更多資訊,請參考文件 :ref:`types` 中的標準型別的層次。" -#: ../../library/functions.rst:1600 +#: ../../library/functions.rst:1603 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1602 +#: ../../library/functions.rst:1605 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1608 +#: ../../library/functions.rst:1611 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1612 +#: ../../library/functions.rst:1615 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2595,32 +2598,32 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1621 #, fuzzy msgid "The *start* parameter can be specified as a keyword argument." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1623 +#: ../../library/functions.rst:1626 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1627 +#: ../../library/functions.rst:1630 msgid "" "The *object-or-type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1631 +#: ../../library/functions.rst:1634 msgid "" "For example, if :attr:`~class.__mro__` of *object-or-type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1635 +#: ../../library/functions.rst:1638 msgid "" "The :attr:`~class.__mro__` attribute of the *object-or-type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2628,7 +2631,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1640 +#: ../../library/functions.rst:1643 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2636,7 +2639,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1645 +#: ../../library/functions.rst:1648 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2644,7 +2647,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1650 +#: ../../library/functions.rst:1653 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2657,18 +2660,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1660 +#: ../../library/functions.rst:1663 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1667 +#: ../../library/functions.rst:1670 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1671 +#: ../../library/functions.rst:1674 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2678,7 +2681,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1678 +#: ../../library/functions.rst:1681 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2688,33 +2691,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1685 +#: ../../library/functions.rst:1688 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1694 +#: ../../library/functions.rst:1697 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1703 +#: ../../library/functions.rst:1706 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1707 +#: ../../library/functions.rst:1710 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1711 +#: ../../library/functions.rst:1714 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2727,11 +2730,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1726 +#: ../../library/functions.rst:1729 msgid "See also :ref:`bltin-type-objects`." msgstr "" -#: ../../library/functions.rst:1728 +#: ../../library/functions.rst:1731 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2739,24 +2742,24 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1733 +#: ../../library/functions.rst:1736 #, fuzzy msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1735 +#: ../../library/functions.rst:1738 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1741 +#: ../../library/functions.rst:1744 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1744 +#: ../../library/functions.rst:1747 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2764,25 +2767,25 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1749 +#: ../../library/functions.rst:1752 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1753 +#: ../../library/functions.rst:1756 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1759 +#: ../../library/functions.rst:1762 msgid "Make an iterator that aggregates elements from each of the iterables." msgstr "" -#: ../../library/functions.rst:1761 +#: ../../library/functions.rst:1764 msgid "" "Returns an iterator of tuples, where the *i*-th tuple contains the *i*-th " "element from each of the argument sequences or iterables. The iterator " @@ -2791,7 +2794,7 @@ msgid "" "an empty iterator. Equivalent to::" msgstr "" -#: ../../library/functions.rst:1780 +#: ../../library/functions.rst:1783 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2800,26 +2803,26 @@ msgid "" "This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1786 +#: ../../library/functions.rst:1789 msgid "" ":func:`zip` should only be used with unequal length inputs when you don't " "care about trailing, unmatched values from the longer iterables. If those " "values are important, use :func:`itertools.zip_longest` instead." msgstr "" -#: ../../library/functions.rst:1790 +#: ../../library/functions.rst:1793 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1811 +#: ../../library/functions.rst:1814 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1814 +#: ../../library/functions.rst:1817 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2831,7 +2834,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1823 +#: ../../library/functions.rst:1826 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -2841,7 +2844,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1830 +#: ../../library/functions.rst:1833 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -2850,7 +2853,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:1836 +#: ../../library/functions.rst:1839 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -2858,58 +2861,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:1841 +#: ../../library/functions.rst:1844 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:1846 +#: ../../library/functions.rst:1849 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:1850 +#: ../../library/functions.rst:1853 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1853 +#: ../../library/functions.rst:1856 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:1860 +#: ../../library/functions.rst:1863 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:1864 +#: ../../library/functions.rst:1867 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1870 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:1871 +#: ../../library/functions.rst:1874 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:1876 +#: ../../library/functions.rst:1879 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:1877 +#: ../../library/functions.rst:1880 #, fuzzy msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " diff --git a/library/intro.po b/library/intro.po index ed8099a77c..d35e35be72 100644 --- a/library/intro.po +++ b/library/intro.po @@ -4,15 +4,15 @@ # # Translators: # Liang-Bo Wang , 2016 -# eopXD, 2018 +# eopXD , 2018 # Matt Wang , 2021 # msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-07 22:47+0800\n" -"PO-Revision-Date: 2021-10-26 15:56+0800\n" +"POT-Creation-Date: 2021-10-26 08:56+0000\n" +"PO-Revision-Date: 2021-10-26 17:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -108,8 +108,8 @@ msgstr "" "\\ 像是在讀一本小說一樣讀這本手冊——你可以快速瀏覽目錄(在手冊的最前頭)、或是" "你可以利用最後面的索引來查詢特定的函式或模組。最後,如果你享受閱讀一些隨機的" "主題,你可以選擇一個隨機的數字並開始閱讀(見 :mod:`random` 模組) 。不管你想要" -"以什麼順序來閱讀這個手冊,\\ :ref:`built-in-funcs` 會是一個很好的入門,因為手" -"冊中其他章節都預設你已經對這個章節有一定的熟悉程度。" +"以什麼順序來閱讀這個手冊,\\ :ref:`built-in-funcs`\\ 會是一個很好的入門,因為" +"手冊中其他章節都預設你已經對這個章節有一定的熟悉程度。" #: ../../library/intro.rst:48 msgid "Let the show begin!" @@ -131,7 +131,7 @@ msgstr "" #: ../../library/intro.rst:60 msgid "" "If not separately noted, all functions that claim \"Availability: Unix\" are " -"supported on Mac OS X, which builds on a Unix core." +"supported on macOS, which builds on a Unix core." msgstr "" -"如果沒有分別註釋的話,有標明「適用:Unix」註釋的所有函式也都於 Mac OS X 上支" -"援,因其建於 Unix 核心之上。" +"如果沒有分別註釋的話,有標明「適用:Unix」註釋的所有函式也都於 macOS 上支援," +"因其建於 Unix 核心之上。" diff --git a/library/socket.po b/library/socket.po index 80cae64d48..15bc6adc8f 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-06 00:11+0000\n" +"POT-Creation-Date: 2021-10-22 00:14+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-" @@ -100,8 +100,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:63 ../../library/socket.rst:966 -#: ../../library/socket.rst:1008 ../../library/socket.rst:1738 +#: ../../library/socket.rst:63 ../../library/socket.rst:970 +#: ../../library/socket.rst:1012 ../../library/socket.rst:1742 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -338,7 +338,7 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:200 +#: ../../library/socket.rst:202 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " "with services running on co-processors in Qualcomm platforms. The address " @@ -346,7 +346,7 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:207 +#: ../../library/socket.rst:211 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " "what portion of a packet is covered with the checksum. It adds two socket " @@ -357,14 +357,14 @@ msgid "" "of their data. In both cases ``length`` should be in ``range(8, 2**16, 8)``." msgstr "" -#: ../../library/socket.rst:216 +#: ../../library/socket.rst:220 msgid "" "Such a socket should be constructed with ``socket(AF_INET, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv4 or ``socket(AF_INET6, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv6." msgstr "" -#: ../../library/socket.rst:224 +#: ../../library/socket.rst:228 msgid "" "If you use a hostname in the *host* portion of IPv4/v6 socket address, the " "program may show a nondeterministic behavior, as Python uses the first " @@ -374,7 +374,7 @@ msgid "" "deterministic behavior use a numeric address in *host* portion." msgstr "" -#: ../../library/socket.rst:231 +#: ../../library/socket.rst:235 msgid "" "All errors raise exceptions. The normal exceptions for invalid argument " "types and out-of-memory conditions can be raised; starting from Python 3.3, " @@ -382,34 +382,34 @@ msgid "" "its subclasses (they used to raise :exc:`socket.error`)." msgstr "" -#: ../../library/socket.rst:236 +#: ../../library/socket.rst:240 msgid "" "Non-blocking mode is supported through :meth:`~socket.setblocking`. A " "generalization of this based on timeouts is supported through :meth:`~socket." "settimeout`." msgstr "" -#: ../../library/socket.rst:242 +#: ../../library/socket.rst:246 msgid "Module contents" msgstr "" -#: ../../library/socket.rst:244 +#: ../../library/socket.rst:248 msgid "The module :mod:`socket` exports the following elements." msgstr "" -#: ../../library/socket.rst:248 +#: ../../library/socket.rst:252 msgid "Exceptions" msgstr "" -#: ../../library/socket.rst:252 +#: ../../library/socket.rst:256 msgid "A deprecated alias of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:254 +#: ../../library/socket.rst:258 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:260 +#: ../../library/socket.rst:264 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors, i.e. for functions that use *h_errno* in the POSIX C API, including :" @@ -419,12 +419,12 @@ msgid "" "description of *h_errno*, as returned by the :c:func:`hstrerror` C function." msgstr "" -#: ../../library/socket.rst:268 ../../library/socket.rst:281 -#: ../../library/socket.rst:292 +#: ../../library/socket.rst:272 ../../library/socket.rst:285 +#: ../../library/socket.rst:296 msgid "This class was made a subclass of :exc:`OSError`." msgstr "" -#: ../../library/socket.rst:273 +#: ../../library/socket.rst:277 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors by :func:`getaddrinfo` and :func:`getnameinfo`. The accompanying " @@ -434,7 +434,7 @@ msgid "" "match one of the :const:`EAI_\\*` constants defined in this module." msgstr "" -#: ../../library/socket.rst:286 +#: ../../library/socket.rst:290 msgid "" "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs " "on a socket which has had timeouts enabled via a prior call to :meth:" @@ -443,17 +443,17 @@ msgid "" "currently always \"timed out\"." msgstr "" -#: ../../library/socket.rst:297 +#: ../../library/socket.rst:301 msgid "Constants" msgstr "" -#: ../../library/socket.rst:299 +#: ../../library/socket.rst:303 msgid "" "The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:" "`SocketKind` :class:`.IntEnum` collections." msgstr "" -#: ../../library/socket.rst:308 +#: ../../library/socket.rst:312 msgid "" "These constants represent the address (and protocol) families, used for the " "first argument to :func:`.socket`. If the :const:`AF_UNIX` constant is not " @@ -461,7 +461,7 @@ msgid "" "depending on the system." msgstr "" -#: ../../library/socket.rst:320 +#: ../../library/socket.rst:324 msgid "" "These constants represent the socket types, used for the second argument to :" "func:`.socket`. More constants may be available depending on the system. " @@ -469,24 +469,24 @@ msgid "" "useful.)" msgstr "" -#: ../../library/socket.rst:328 +#: ../../library/socket.rst:332 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: ../../library/socket.rst:334 +#: ../../library/socket.rst:338 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:338 +#: ../../library/socket.rst:342 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr "" -#: ../../library/socket.rst:356 +#: ../../library/socket.rst:360 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " @@ -496,181 +496,181 @@ msgid "" "default values are provided." msgstr "" -#: ../../library/socket.rst:363 +#: ../../library/socket.rst:367 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: ../../library/socket.rst:367 +#: ../../library/socket.rst:371 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:371 +#: ../../library/socket.rst:375 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "" -#: ../../library/socket.rst:374 +#: ../../library/socket.rst:378 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:382 ../../library/socket.rst:449 -#: ../../library/socket.rst:460 +#: ../../library/socket.rst:386 ../../library/socket.rst:453 +#: ../../library/socket.rst:464 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:386 ../../library/socket.rst:397 -#: ../../library/socket.rst:432 +#: ../../library/socket.rst:390 ../../library/socket.rst:401 +#: ../../library/socket.rst:436 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr "" -#: ../../library/socket.rst:392 +#: ../../library/socket.rst:396 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:399 +#: ../../library/socket.rst:403 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:405 +#: ../../library/socket.rst:409 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: ../../library/socket.rst:409 ../../library/socket.rst:420 +#: ../../library/socket.rst:413 ../../library/socket.rst:424 msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:412 +#: ../../library/socket.rst:416 msgid ":ref:`Availability `: Linux >= 3.6." msgstr "" -#: ../../library/socket.rst:417 +#: ../../library/socket.rst:421 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:423 +#: ../../library/socket.rst:427 msgid ":ref:`Availability `: Linux >= 4.1." msgstr "" -#: ../../library/socket.rst:428 +#: ../../library/socket.rst:432 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:437 +#: ../../library/socket.rst:441 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:441 +#: ../../library/socket.rst:445 msgid ":ref:`Availability `: Linux >= 5.4." msgstr "" -#: ../../library/socket.rst:452 +#: ../../library/socket.rst:456 msgid ":ref:`Availability `: Linux >= 2.2." msgstr "" -#: ../../library/socket.rst:464 +#: ../../library/socket.rst:468 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr "" -#: ../../library/socket.rst:473 +#: ../../library/socket.rst:477 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:476 ../../library/socket.rst:1360 +#: ../../library/socket.rst:480 ../../library/socket.rst:1364 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "" -#: ../../library/socket.rst:482 +#: ../../library/socket.rst:486 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: ../../library/socket.rst:489 +#: ../../library/socket.rst:493 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:492 ../../library/socket.rst:1660 +#: ../../library/socket.rst:496 ../../library/socket.rst:1664 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr "" -#: ../../library/socket.rst:501 +#: ../../library/socket.rst:505 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:504 +#: ../../library/socket.rst:508 msgid ":ref:`Availability `: Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:510 +#: ../../library/socket.rst:514 msgid ":ref:`Availability `: BSD, macOS." msgstr "" -#: ../../library/socket.rst:515 +#: ../../library/socket.rst:519 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: ../../library/socket.rst:521 +#: ../../library/socket.rst:525 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: ../../library/socket.rst:530 +#: ../../library/socket.rst:534 msgid "" "For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " "NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " "are not available for FreeBSD, NetBSD, or DragonFlyBSD." msgstr "" -#: ../../library/socket.rst:537 +#: ../../library/socket.rst:541 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: ../../library/socket.rst:540 +#: ../../library/socket.rst:544 msgid ":ref:`Availability `: Linux >= 4.7." msgstr "" -#: ../../library/socket.rst:543 +#: ../../library/socket.rst:547 msgid "Functions" msgstr "" -#: ../../library/socket.rst:546 +#: ../../library/socket.rst:550 msgid "Creating sockets" msgstr "" -#: ../../library/socket.rst:548 +#: ../../library/socket.rst:552 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:553 +#: ../../library/socket.rst:557 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -683,7 +683,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: ../../library/socket.rst:563 +#: ../../library/socket.rst:567 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -694,51 +694,51 @@ msgid "" "This may help close a detached socket using :meth:`socket.close()`." msgstr "" -#: ../../library/socket.rst:572 ../../library/socket.rst:706 -#: ../../library/socket.rst:1190 ../../library/socket.rst:1277 +#: ../../library/socket.rst:576 ../../library/socket.rst:710 +#: ../../library/socket.rst:1194 ../../library/socket.rst:1281 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:574 +#: ../../library/socket.rst:578 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." msgstr "" -#: ../../library/socket.rst:576 +#: ../../library/socket.rst:580 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: ../../library/socket.rst:580 +#: ../../library/socket.rst:584 msgid "The CAN_BCM protocol was added." msgstr "" -#: ../../library/socket.rst:583 ../../library/socket.rst:708 +#: ../../library/socket.rst:587 ../../library/socket.rst:712 msgid "The returned socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:586 +#: ../../library/socket.rst:590 msgid "The CAN_ISOTP protocol was added." msgstr "" -#: ../../library/socket.rst:589 +#: ../../library/socket.rst:593 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system `socket()` call. Therefore," msgstr "" -#: ../../library/socket.rst:601 +#: ../../library/socket.rst:605 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: ../../library/socket.rst:605 +#: ../../library/socket.rst:609 msgid "The CAN_J1939 protocol was added." msgstr "" -#: ../../library/socket.rst:610 +#: ../../library/socket.rst:614 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -747,25 +747,25 @@ msgid "" "`AF_INET`." msgstr "" -#: ../../library/socket.rst:615 +#: ../../library/socket.rst:619 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:617 +#: ../../library/socket.rst:621 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:621 +#: ../../library/socket.rst:625 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:624 +#: ../../library/socket.rst:628 msgid "Windows support added." msgstr "" -#: ../../library/socket.rst:630 +#: ../../library/socket.rst:634 msgid "" "Connect to a TCP service listening on the Internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -776,31 +776,31 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:638 +#: ../../library/socket.rst:642 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:643 +#: ../../library/socket.rst:647 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:647 +#: ../../library/socket.rst:651 msgid "*source_address* was added." msgstr "" -#: ../../library/socket.rst:652 +#: ../../library/socket.rst:656 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and return the socket object." msgstr "" -#: ../../library/socket.rst:655 +#: ../../library/socket.rst:659 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; when ``0`` a default " @@ -808,7 +808,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:660 +#: ../../library/socket.rst:664 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " "able to accept both IPv4 and IPv6 connections, else it will raise :exc:" @@ -821,20 +821,20 @@ msgid "" "func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:682 +#: ../../library/socket.rst:686 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:690 +#: ../../library/socket.rst:694 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:697 +#: ../../library/socket.rst:701 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`fileno` method) and build a socket object from the result. " @@ -847,38 +847,38 @@ msgid "" "socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:714 +#: ../../library/socket.rst:718 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:718 ../../library/socket.rst:1763 +#: ../../library/socket.rst:722 ../../library/socket.rst:1767 msgid ":ref:`Availability `: Windows." msgstr "" -#: ../../library/socket.rst:724 +#: ../../library/socket.rst:728 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: ../../library/socket.rst:729 +#: ../../library/socket.rst:733 msgid "Other functions" msgstr "" -#: ../../library/socket.rst:731 +#: ../../library/socket.rst:735 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:736 +#: ../../library/socket.rst:740 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:744 +#: ../../library/socket.rst:748 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -888,7 +888,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:751 +#: ../../library/socket.rst:755 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to narrow the list of addresses returned. Passing zero as a value for " @@ -899,15 +899,15 @@ msgid "" "domain name." msgstr "" -#: ../../library/socket.rst:759 +#: ../../library/socket.rst:763 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:761 +#: ../../library/socket.rst:765 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "" -#: ../../library/socket.rst:763 +#: ../../library/socket.rst:767 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`.socket` function. *canonname* will be a string " @@ -919,30 +919,30 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:773 +#: ../../library/socket.rst:777 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." msgstr "" -#: ../../library/socket.rst:775 +#: ../../library/socket.rst:779 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:785 +#: ../../library/socket.rst:789 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:788 +#: ../../library/socket.rst:792 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:794 +#: ../../library/socket.rst:798 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -953,7 +953,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:805 +#: ../../library/socket.rst:809 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -963,13 +963,13 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:811 ../../library/socket.rst:825 +#: ../../library/socket.rst:815 ../../library/socket.rst:829 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" -#: ../../library/socket.rst:816 +#: ../../library/socket.rst:820 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a " "triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -981,25 +981,25 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:830 +#: ../../library/socket.rst:834 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:833 +#: ../../library/socket.rst:837 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" -#: ../../library/socket.rst:835 +#: ../../library/socket.rst:839 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:841 +#: ../../library/socket.rst:845 msgid "" "Return a triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1010,13 +1010,13 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:849 +#: ../../library/socket.rst:853 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" -#: ../../library/socket.rst:854 +#: ../../library/socket.rst:858 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully-" @@ -1024,24 +1024,24 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:859 +#: ../../library/socket.rst:863 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:862 +#: ../../library/socket.rst:866 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:864 +#: ../../library/socket.rst:868 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" -#: ../../library/socket.rst:868 +#: ../../library/socket.rst:872 msgid "" "Translate an Internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`.socket` " @@ -1050,47 +1050,47 @@ msgid "" "chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:877 +#: ../../library/socket.rst:881 msgid "" "Translate an Internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:881 +#: ../../library/socket.rst:885 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." msgstr "" -#: ../../library/socket.rst:886 +#: ../../library/socket.rst:890 msgid "" "Translate an Internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:890 +#: ../../library/socket.rst:894 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." msgstr "" -#: ../../library/socket.rst:895 +#: ../../library/socket.rst:899 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:902 +#: ../../library/socket.rst:906 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:906 ../../library/socket.rst:926 +#: ../../library/socket.rst:910 ../../library/socket.rst:930 msgid "" "In case *x* does not fit in 16-bit unsigned integer, but does fit in a " "positive C int, it is silently truncated to 16-bit unsigned integer. This " @@ -1098,21 +1098,21 @@ msgid "" "future versions of Python." msgstr "" -#: ../../library/socket.rst:915 +#: ../../library/socket.rst:919 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:922 +#: ../../library/socket.rst:926 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:935 +#: ../../library/socket.rst:939 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1122,26 +1122,26 @@ msgid "" "returns." msgstr "" -#: ../../library/socket.rst:941 +#: ../../library/socket.rst:945 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:944 +#: ../../library/socket.rst:948 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:948 +#: ../../library/socket.rst:952 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:958 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1151,7 +1151,7 @@ msgid "" "an argument." msgstr "" -#: ../../library/socket.rst:961 +#: ../../library/socket.rst:965 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1159,7 +1159,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:972 +#: ../../library/socket.rst:976 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1167,7 +1167,7 @@ msgid "" "func:`inet_aton`) or :c:type:`struct in6_addr`." msgstr "" -#: ../../library/socket.rst:977 +#: ../../library/socket.rst:981 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1176,16 +1176,16 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:984 ../../library/socket.rst:1004 +#: ../../library/socket.rst:988 ../../library/socket.rst:1008 msgid "" ":ref:`Availability `: Unix (maybe not all platforms), Windows." msgstr "" -#: ../../library/socket.rst:985 ../../library/socket.rst:1005 +#: ../../library/socket.rst:989 ../../library/socket.rst:1009 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:991 +#: ../../library/socket.rst:995 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1194,7 +1194,7 @@ msgid "" "in_addr` (similar to :func:`inet_ntoa`) or :c:type:`struct in6_addr`." msgstr "" -#: ../../library/socket.rst:998 +#: ../../library/socket.rst:1002 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1202,7 +1202,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1020 +#: ../../library/socket.rst:1024 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1213,14 +1213,14 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1030 ../../library/socket.rst:1051 -#: ../../library/socket.rst:1496 ../../library/socket.rst:1538 -#: ../../library/socket.rst:1644 +#: ../../library/socket.rst:1034 ../../library/socket.rst:1055 +#: ../../library/socket.rst:1500 ../../library/socket.rst:1542 +#: ../../library/socket.rst:1648 msgid "" ":ref:`Availability `: most Unix platforms, possibly others." msgstr "" -#: ../../library/socket.rst:1036 +#: ../../library/socket.rst:1040 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1230,7 +1230,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1044 +#: ../../library/socket.rst:1048 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1238,143 +1238,143 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1057 +#: ../../library/socket.rst:1061 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1064 +#: ../../library/socket.rst:1068 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1072 +#: ../../library/socket.rst:1076 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1079 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." msgstr "" -#: ../../library/socket.rst:1078 +#: ../../library/socket.rst:1082 msgid ":ref:`Availability `: Unix." msgstr "" -#: ../../library/socket.rst:1084 +#: ../../library/socket.rst:1088 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1089 ../../library/socket.rst:1116 -#: ../../library/socket.rst:1133 +#: ../../library/socket.rst:1093 ../../library/socket.rst:1120 +#: ../../library/socket.rst:1137 msgid ":ref:`Availability `: Unix, Windows." msgstr "" -#: ../../library/socket.rst:1092 ../../library/socket.rst:1119 -#: ../../library/socket.rst:1136 +#: ../../library/socket.rst:1096 ../../library/socket.rst:1123 +#: ../../library/socket.rst:1140 msgid "Windows support was added." msgstr "" -#: ../../library/socket.rst:1097 +#: ../../library/socket.rst:1101 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1104 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "" -#: ../../library/socket.rst:1101 +#: ../../library/socket.rst:1105 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1102 +#: ../../library/socket.rst:1106 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1103 +#: ../../library/socket.rst:1107 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1105 +#: ../../library/socket.rst:1109 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1111 +#: ../../library/socket.rst:1115 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1123 ../../library/socket.rst:1140 +#: ../../library/socket.rst:1127 ../../library/socket.rst:1144 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1128 +#: ../../library/socket.rst:1132 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1145 +#: ../../library/socket.rst:1149 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1150 +#: ../../library/socket.rst:1154 msgid "" ":ref:`Availability `: Unix supporting :meth:`~socket.sendmsg` " "and :const:`SCM_RIGHTS` mechanism." msgstr "" -#: ../../library/socket.rst:1156 +#: ../../library/socket.rst:1160 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " "for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1161 +#: ../../library/socket.rst:1165 msgid "" ":ref:`Availability `: Unix supporting :meth:`~socket.recvmsg` " "and :const:`SCM_RIGHTS` mechanism." msgstr "" -#: ../../library/socket.rst:1166 +#: ../../library/socket.rst:1170 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1172 +#: ../../library/socket.rst:1176 msgid "Socket Objects" msgstr "" -#: ../../library/socket.rst:1174 +#: ../../library/socket.rst:1178 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1178 +#: ../../library/socket.rst:1182 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1185 +#: ../../library/socket.rst:1189 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1383,33 +1383,33 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1192 ../../library/socket.rst:1279 +#: ../../library/socket.rst:1196 ../../library/socket.rst:1283 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1195 ../../library/socket.rst:1410 -#: ../../library/socket.rst:1424 ../../library/socket.rst:1499 -#: ../../library/socket.rst:1570 ../../library/socket.rst:1589 -#: ../../library/socket.rst:1606 ../../library/socket.rst:1649 +#: ../../library/socket.rst:1199 ../../library/socket.rst:1414 +#: ../../library/socket.rst:1428 ../../library/socket.rst:1503 +#: ../../library/socket.rst:1574 ../../library/socket.rst:1593 +#: ../../library/socket.rst:1610 ../../library/socket.rst:1653 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1203 +#: ../../library/socket.rst:1207 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1206 +#: ../../library/socket.rst:1210 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1210 +#: ../../library/socket.rst:1214 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1418,20 +1418,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1216 +#: ../../library/socket.rst:1220 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1220 +#: ../../library/socket.rst:1224 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1226 +#: ../../library/socket.rst:1230 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1439,13 +1439,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1234 +#: ../../library/socket.rst:1238 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1237 +#: ../../library/socket.rst:1241 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`socket.timeout` on timeout, if the " @@ -1455,13 +1455,13 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1244 ../../library/socket.rst:1262 +#: ../../library/socket.rst:1248 ../../library/socket.rst:1266 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1246 +#: ../../library/socket.rst:1250 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1469,7 +1469,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1255 +#: ../../library/socket.rst:1259 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1479,38 +1479,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1266 +#: ../../library/socket.rst:1270 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1275 +#: ../../library/socket.rst:1279 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1285 +#: ../../library/socket.rst:1289 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1288 +#: ../../library/socket.rst:1292 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1294 +#: ../../library/socket.rst:1298 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1303 +#: ../../library/socket.rst:1307 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1518,14 +1518,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1311 +#: ../../library/socket.rst:1315 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1318 +#: ../../library/socket.rst:1322 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1537,16 +1537,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1330 +#: ../../library/socket.rst:1334 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1333 +#: ../../library/socket.rst:1337 msgid "This is equivalent to checking ``socket.gettimeout() == 0``." msgstr "" -#: ../../library/socket.rst:1340 +#: ../../library/socket.rst:1344 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1557,30 +1557,30 @@ msgstr "" msgid "platform" msgstr "" -#: ../../library/socket.rst:1347 +#: ../../library/socket.rst:1351 msgid "Windows" msgstr "" -#: ../../library/socket.rst:1349 +#: ../../library/socket.rst:1353 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1354 +#: ../../library/socket.rst:1358 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1357 +#: ../../library/socket.rst:1361 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1365 +#: ../../library/socket.rst:1369 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1588,11 +1588,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1370 +#: ../../library/socket.rst:1374 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1378 +#: ../../library/socket.rst:1382 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1601,28 +1601,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1383 +#: ../../library/socket.rst:1387 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1387 +#: ../../library/socket.rst:1391 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1393 +#: ../../library/socket.rst:1397 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1400 +#: ../../library/socket.rst:1404 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1631,13 +1631,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1407 +#: ../../library/socket.rst:1411 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1418 +#: ../../library/socket.rst:1422 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1647,14 +1647,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1429 +#: ../../library/socket.rst:1433 msgid "" "For multicast IPv6 address, first item of *address* does not contain ``" "%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1436 +#: ../../library/socket.rst:1440 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1665,7 +1665,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1446 +#: ../../library/socket.rst:1450 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1680,7 +1680,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1460 +#: ../../library/socket.rst:1464 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1693,7 +1693,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1471 +#: ../../library/socket.rst:1475 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1702,7 +1702,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1478 +#: ../../library/socket.rst:1482 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1711,7 +1711,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1507 +#: ../../library/socket.rst:1511 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1724,7 +1724,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1518 +#: ../../library/socket.rst:1522 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1732,11 +1732,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1523 +#: ../../library/socket.rst:1527 msgid "Example::" msgstr "" -#: ../../library/socket.rst:1544 +#: ../../library/socket.rst:1548 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1746,7 +1746,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1554 +#: ../../library/socket.rst:1558 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1755,7 +1755,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1563 +#: ../../library/socket.rst:1567 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1765,7 +1765,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1578 +#: ../../library/socket.rst:1582 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1775,13 +1775,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1585 +#: ../../library/socket.rst:1589 msgid "" "The socket timeout is no more reset each time data is sent successfully. The " "socket timeout is now the maximum total duration to send all data." msgstr "" -#: ../../library/socket.rst:1598 +#: ../../library/socket.rst:1602 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -1790,13 +1790,13 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1604 +#: ../../library/socket.rst:1608 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1614 +#: ../../library/socket.rst:1618 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -1816,27 +1816,27 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1634 +#: ../../library/socket.rst:1638 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1645 +#: ../../library/socket.rst:1649 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." msgstr "" -#: ../../library/socket.rst:1656 +#: ../../library/socket.rst:1660 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1665 +#: ../../library/socket.rst:1669 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -1850,38 +1850,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1681 +#: ../../library/socket.rst:1685 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1689 +#: ../../library/socket.rst:1693 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1692 +#: ../../library/socket.rst:1696 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1694 +#: ../../library/socket.rst:1698 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "" -#: ../../library/socket.rst:1696 +#: ../../library/socket.rst:1700 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "" -#: ../../library/socket.rst:1698 +#: ../../library/socket.rst:1702 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1705 +#: ../../library/socket.rst:1709 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating point number expressing seconds, or ``None``. If a non-" @@ -1891,19 +1891,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1712 +#: ../../library/socket.rst:1716 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1714 +#: ../../library/socket.rst:1718 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1727 +#: ../../library/socket.rst:1731 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -1916,11 +1916,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1741 +#: ../../library/socket.rst:1745 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1747 +#: ../../library/socket.rst:1751 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -1928,7 +1928,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1755 +#: ../../library/socket.rst:1759 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -1939,48 +1939,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1767 +#: ../../library/socket.rst:1771 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1770 +#: ../../library/socket.rst:1774 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:1776 +#: ../../library/socket.rst:1780 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1781 +#: ../../library/socket.rst:1785 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:1786 +#: ../../library/socket.rst:1790 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:1793 +#: ../../library/socket.rst:1797 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:1795 +#: ../../library/socket.rst:1799 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:1799 +#: ../../library/socket.rst:1803 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:1802 +#: ../../library/socket.rst:1806 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -1988,14 +1988,14 @@ msgid "" "for reading or writing." msgstr "" -#: ../../library/socket.rst:1807 +#: ../../library/socket.rst:1811 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:1812 +#: ../../library/socket.rst:1816 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2004,11 +2004,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:1819 +#: ../../library/socket.rst:1823 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:1821 +#: ../../library/socket.rst:1825 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2018,24 +2018,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:1829 +#: ../../library/socket.rst:1833 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:1831 +#: ../../library/socket.rst:1835 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:1835 +#: ../../library/socket.rst:1839 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1842 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2043,11 +2043,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:1847 +#: ../../library/socket.rst:1851 msgid "Example" msgstr "" -#: ../../library/socket.rst:1849 +#: ../../library/socket.rst:1853 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2060,11 +2060,11 @@ msgid "" "new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:1859 +#: ../../library/socket.rst:1863 msgid "The first two examples support IPv4 only. ::" msgstr "" -#: ../../library/socket.rst:1890 +#: ../../library/socket.rst:1894 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2074,73 +2074,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:1962 +#: ../../library/socket.rst:1966 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:1987 +#: ../../library/socket.rst:1991 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:1993 +#: ../../library/socket.rst:1997 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send`, and the :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:1997 +#: ../../library/socket.rst:2001 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2037 +#: ../../library/socket.rst:2041 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2042 +#: ../../library/socket.rst:2046 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2045 +#: ../../library/socket.rst:2049 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :data:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2052 +#: ../../library/socket.rst:2056 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2062 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2060 +#: ../../library/socket.rst:2064 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2062 +#: ../../library/socket.rst:2066 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2065 +#: ../../library/socket.rst:2069 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " diff --git a/tutorial/introduction.po b/tutorial/introduction.po index fca7a71e27..67b71bb464 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-21 15:40+0000\n" "PO-Revision-Date: 2021-06-08 13:21+0800\n" "Last-Translator: Ching-Hao Liu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,6 +42,14 @@ msgstr "" #: ../../tutorial/introduction.rst:16 msgid "" +"You can toggle the display of prompts and output by clicking on ``>>>`` in " +"the upper-right corner of an example box. If you hide the prompts and " +"output for an example, then you can easily copy and paste the input lines " +"into your interpreter." +msgstr "" + +#: ../../tutorial/introduction.rst:23 +msgid "" "Many of the examples in this manual, even those entered at the interactive " "prompt, include comments. Comments in Python start with the hash character, " "``#``, and extend to the end of the physical line. A comment may appear at " @@ -56,18 +64,18 @@ msgstr "" "字串文本之中時仍視為一 hash 字元。因為註解只是用來說明程式而不會被 Python 解" "讀,在練習範例時不一定要輸入。" -#: ../../tutorial/introduction.rst:24 +#: ../../tutorial/introduction.rst:31 msgid "Some examples::" msgstr "" "一些範例如下:\n" "\n" "::" -#: ../../tutorial/introduction.rst:35 +#: ../../tutorial/introduction.rst:42 msgid "Using Python as a Calculator" msgstr "把 Python 當作計算機使用" -#: ../../tutorial/introduction.rst:37 +#: ../../tutorial/introduction.rst:44 msgid "" "Let's try some simple Python commands. Start the interpreter and wait for " "the primary prompt, ``>>>``. (It shouldn't take long.)" @@ -75,11 +83,11 @@ msgstr "" "讓我們來試試一些簡單的 Python 指令。啟動直譯器並等待第一個主提示符 ``>>>`` 出" "現。(應該不會等太久)" -#: ../../tutorial/introduction.rst:44 +#: ../../tutorial/introduction.rst:51 msgid "Numbers" msgstr "數字 (Number)" -#: ../../tutorial/introduction.rst:46 +#: ../../tutorial/introduction.rst:53 msgid "" "The interpreter acts as a simple calculator: you can type an expression at " "it and it will write the value. Expression syntax is straightforward: the " @@ -93,7 +101,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:61 +#: ../../tutorial/introduction.rst:68 msgid "" "The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, the " "ones with a fractional part (e.g. ``5.0``, ``1.6``) have type :class:" @@ -103,7 +111,7 @@ msgstr "" "(即 ``5.0``、``1.6``)為 :class:`float` 型態。我們將在之後的教學中看到更多數" "字相關的型態。" -#: ../../tutorial/introduction.rst:65 +#: ../../tutorial/introduction.rst:72 msgid "" "Division (``/``) always returns a float. To do :term:`floor division` and " "get an integer result (discarding any fractional result) you can use the ``//" @@ -115,7 +123,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:79 +#: ../../tutorial/introduction.rst:86 msgid "" "With Python, it is possible to use the ``**`` operator to calculate powers " "[#]_::" @@ -124,7 +132,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:86 +#: ../../tutorial/introduction.rst:93 msgid "" "The equal sign (``=``) is used to assign a value to a variable. Afterwards, " "no result is displayed before the next interactive prompt::" @@ -134,7 +142,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:94 +#: ../../tutorial/introduction.rst:101 msgid "" "If a variable is not \"defined\" (assigned a value), trying to use it will " "give you an error::" @@ -144,7 +152,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:102 +#: ../../tutorial/introduction.rst:109 msgid "" "There is full support for floating point; operators with mixed type operands " "convert the integer operand to floating point::" @@ -154,7 +162,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:108 +#: ../../tutorial/introduction.rst:115 msgid "" "In interactive mode, the last printed expression is assigned to the variable " "``_``. This means that when you are using Python as a desk calculator, it " @@ -165,7 +173,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:121 +#: ../../tutorial/introduction.rst:128 msgid "" "This variable should be treated as read-only by the user. Don't explicitly " "assign a value to it --- you would create an independent local variable with " @@ -174,7 +182,7 @@ msgstr "" "這個變數應該被使用者視為只能讀取。不應該明確地為它賦值 --- 你可以創一個獨立但" "名稱相同的本地變數來覆蓋掉預設變數和它的神奇行為。" -#: ../../tutorial/introduction.rst:125 +#: ../../tutorial/introduction.rst:132 msgid "" "In addition to :class:`int` and :class:`float`, Python supports other types " "of numbers, such as :class:`~decimal.Decimal` and :class:`~fractions." @@ -187,11 +195,11 @@ msgstr "" "\\ :ref:`複數 (complex numbers) `,並使用 ``j`` 和 ``J`` 後綴來" "指定虛數的部份(即 ``3+5j``)。" -#: ../../tutorial/introduction.rst:135 +#: ../../tutorial/introduction.rst:142 msgid "Strings" msgstr "字串 (String)" -#: ../../tutorial/introduction.rst:137 +#: ../../tutorial/introduction.rst:144 msgid "" "Besides numbers, Python can also manipulate strings, which can be expressed " "in several ways. They can be enclosed in single quotes (``'...'``) or " @@ -204,7 +212,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:155 +#: ../../tutorial/introduction.rst:162 msgid "" "In the interactive interpreter, the output string is enclosed in quotes and " "special characters are escaped with backslashes. While this might sometimes " @@ -223,7 +231,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:175 +#: ../../tutorial/introduction.rst:182 msgid "" "If you don't want characters prefaced by ``\\`` to be interpreted as special " "characters, you can use *raw strings* by adding an ``r`` before the first " @@ -234,7 +242,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:185 +#: ../../tutorial/introduction.rst:192 msgid "" "String literals can span multiple lines. One way is using triple-quotes: ``" "\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically included " @@ -247,13 +255,13 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:196 +#: ../../tutorial/introduction.rst:203 msgid "" "produces the following output (note that the initial newline is not " "included):" msgstr "會產生以下的輸出(注意第一個換行並沒有被包含進字串值中):" -#: ../../tutorial/introduction.rst:204 +#: ../../tutorial/introduction.rst:211 msgid "" "Strings can be concatenated (glued together) with the ``+`` operator, and " "repeated with ``*``::" @@ -262,7 +270,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:211 +#: ../../tutorial/introduction.rst:218 msgid "" "Two or more *string literals* (i.e. the ones enclosed between quotes) next " "to each other are automatically concatenated. ::" @@ -272,7 +280,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:217 +#: ../../tutorial/introduction.rst:224 msgid "" "This feature is particularly useful when you want to break long strings::" msgstr "" @@ -280,7 +288,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:224 +#: ../../tutorial/introduction.rst:231 msgid "" "This only works with two literals though, not with variables or expressions::" msgstr "" @@ -288,7 +296,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:238 +#: ../../tutorial/introduction.rst:245 msgid "" "If you want to concatenate variables or a variable and a literal, use ``+``::" msgstr "" @@ -296,7 +304,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:243 +#: ../../tutorial/introduction.rst:250 msgid "" "Strings can be *indexed* (subscripted), with the first character having " "index 0. There is no separate character type; a character is simply a string " @@ -307,7 +315,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:253 +#: ../../tutorial/introduction.rst:260 msgid "" "Indices may also be negative numbers, to start counting from the right::" msgstr "" @@ -315,11 +323,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:262 +#: ../../tutorial/introduction.rst:269 msgid "Note that since -0 is the same as 0, negative indices start from -1." msgstr "注意到因為 -0 等同於 0,負的索引值由 -1 開始。" -#: ../../tutorial/introduction.rst:264 +#: ../../tutorial/introduction.rst:271 msgid "" "In addition to indexing, *slicing* is also supported. While indexing is " "used to obtain individual characters, *slicing* allows you to obtain " @@ -330,7 +338,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:272 +#: ../../tutorial/introduction.rst:279 msgid "" "Slice indices have useful defaults; an omitted first index defaults to zero, " "an omitted second index defaults to the size of the string being sliced. ::" @@ -340,7 +348,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:282 +#: ../../tutorial/introduction.rst:289 msgid "" "Note how the start is always included, and the end always excluded. This " "makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" @@ -350,7 +358,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:290 +#: ../../tutorial/introduction.rst:297 msgid "" "One way to remember how slices work is to think of the indices as pointing " "*between* characters, with the left edge of the first character numbered 0. " @@ -363,7 +371,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:301 +#: ../../tutorial/introduction.rst:308 msgid "" "The first row of numbers gives the position of the indices 0...6 in the " "string; the second row gives the corresponding negative indices. The slice " @@ -373,7 +381,7 @@ msgstr "" "第一行數字給定字串索引值為 0...6 的位置;第二行則標示了負索引值的位置。由 " "*i* 至 *j* 的 slice 包含了標示 *i* 和 *j* 邊緣間的所有字元。" -#: ../../tutorial/introduction.rst:306 +#: ../../tutorial/introduction.rst:313 msgid "" "For non-negative indices, the length of a slice is the difference of the " "indices, if both are within bounds. For example, the length of " @@ -382,14 +390,14 @@ msgstr "" "對非負數的索引值而言,一個 slice 的長度等於其索引值之差,如果索引值落在字串邊" "界內。例如,``word[1:3]`` 的長度是 2。" -#: ../../tutorial/introduction.rst:310 +#: ../../tutorial/introduction.rst:317 msgid "Attempting to use an index that is too large will result in an error::" msgstr "" "嘗試使用一個過大的索引值會造成錯誤:\n" "\n" "::" -#: ../../tutorial/introduction.rst:317 +#: ../../tutorial/introduction.rst:324 msgid "" "However, out of range slice indexes are handled gracefully when used for " "slicing::" @@ -398,7 +406,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:325 +#: ../../tutorial/introduction.rst:332 msgid "" "Python strings cannot be changed --- they are :term:`immutable`. Therefore, " "assigning to an indexed position in the string results in an error::" @@ -408,61 +416,61 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:337 +#: ../../tutorial/introduction.rst:344 msgid "If you need a different string, you should create a new one::" msgstr "" "如果你需要一個不一樣的字串,你必須建立一個新的:\n" "\n" "::" -#: ../../tutorial/introduction.rst:344 +#: ../../tutorial/introduction.rst:351 msgid "The built-in function :func:`len` returns the length of a string::" msgstr "" "內建的函式 :func:`len` 回傳一個字串的長度:\n" "\n" "::" -#: ../../tutorial/introduction.rst:355 +#: ../../tutorial/introduction.rst:362 msgid ":ref:`textseq`" msgstr ":ref:`textseq`" -#: ../../tutorial/introduction.rst:354 +#: ../../tutorial/introduction.rst:361 msgid "" "Strings are examples of *sequence types*, and support the common operations " "supported by such types." msgstr "字串是 *sequence 型別*\\ 的範例之一,並支援該型別常用的操作。" -#: ../../tutorial/introduction.rst:359 +#: ../../tutorial/introduction.rst:366 msgid ":ref:`string-methods`" msgstr ":ref:`string-methods`" -#: ../../tutorial/introduction.rst:358 +#: ../../tutorial/introduction.rst:365 msgid "" "Strings support a large number of methods for basic transformations and " "searching." msgstr "字串支援非常多種基本轉換和搜尋的 method(方法)。" -#: ../../tutorial/introduction.rst:362 +#: ../../tutorial/introduction.rst:369 msgid ":ref:`f-strings`" msgstr ":ref:`f-strings`" -#: ../../tutorial/introduction.rst:362 +#: ../../tutorial/introduction.rst:369 msgid "String literals that have embedded expressions." msgstr "包含有運算式的字串文本。" -#: ../../tutorial/introduction.rst:365 +#: ../../tutorial/introduction.rst:372 msgid ":ref:`formatstrings`" msgstr ":ref:`formatstrings`" -#: ../../tutorial/introduction.rst:365 +#: ../../tutorial/introduction.rst:372 msgid "Information about string formatting with :meth:`str.format`." msgstr "關於透過 :meth:`str.format` 字串格式化 (string formatting) 的資訊。" -#: ../../tutorial/introduction.rst:368 +#: ../../tutorial/introduction.rst:375 msgid ":ref:`old-string-formatting`" msgstr ":ref:`old-string-formatting`" -#: ../../tutorial/introduction.rst:368 +#: ../../tutorial/introduction.rst:375 msgid "" "The old formatting operations invoked when strings are the left operand of " "the ``%`` operator are described in more detail here." @@ -470,11 +478,11 @@ msgstr "" "在字串為 ``%`` 運算子的左運算元時,將觸發舊的字串格式化操作,更多的細節在本連" "結中介紹。" -#: ../../tutorial/introduction.rst:375 +#: ../../tutorial/introduction.rst:382 msgid "Lists" msgstr "List(串列)" -#: ../../tutorial/introduction.rst:377 +#: ../../tutorial/introduction.rst:384 msgid "" "Python knows a number of *compound* data types, used to group together other " "values. The most versatile is the *list*, which can be written as a list of " @@ -487,7 +495,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:386 +#: ../../tutorial/introduction.rst:393 msgid "" "Like strings (and all other built-in :term:`sequence` types), lists can be " "indexed and sliced::" @@ -497,7 +505,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:396 +#: ../../tutorial/introduction.rst:403 msgid "" "All slice operations return a new list containing the requested elements. " "This means that the following slice returns a :ref:`shallow copy " @@ -508,14 +516,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:403 +#: ../../tutorial/introduction.rst:410 msgid "Lists also support operations like concatenation::" msgstr "" "List 對支援如接合 (concatenation) 等操作:\n" "\n" "::" -#: ../../tutorial/introduction.rst:408 +#: ../../tutorial/introduction.rst:415 msgid "" "Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` " "type, i.e. it is possible to change their content::" @@ -525,7 +533,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:418 +#: ../../tutorial/introduction.rst:425 msgid "" "You can also add new items at the end of the list, by using the :meth:`~list." "append` *method* (we will see more about methods later)::" @@ -535,7 +543,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:426 +#: ../../tutorial/introduction.rst:433 msgid "" "Assignment to slices is also possible, and this can even change the size of " "the list or clear it entirely::" @@ -544,14 +552,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:445 +#: ../../tutorial/introduction.rst:452 msgid "The built-in function :func:`len` also applies to lists::" msgstr "" "內建的函式 :func:`len` 亦可以作用在 list 上:\n" "\n" "::" -#: ../../tutorial/introduction.rst:451 +#: ../../tutorial/introduction.rst:458 msgid "" "It is possible to nest lists (create lists containing other lists), for " "example::" @@ -560,11 +568,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:467 +#: ../../tutorial/introduction.rst:474 msgid "First Steps Towards Programming" msgstr "初探程式設計的前幾步" -#: ../../tutorial/introduction.rst:469 +#: ../../tutorial/introduction.rst:476 msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " @@ -577,11 +585,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:489 +#: ../../tutorial/introduction.rst:496 msgid "This example introduces several new features." msgstr "這例子引入了許多新的特性。" -#: ../../tutorial/introduction.rst:491 +#: ../../tutorial/introduction.rst:498 msgid "" "The first line contains a *multiple assignment*: the variables ``a`` and " "``b`` simultaneously get the new values 0 and 1. On the last line this is " @@ -593,7 +601,7 @@ msgstr "" "同樣的賦值再被使用了一次,示範了等號的右項運算 (expression) 會先被計算 " "(evaluate),賦值再發生。右項的運算式由左至右依序被計算。" -#: ../../tutorial/introduction.rst:497 +#: ../../tutorial/introduction.rst:504 msgid "" "The :keyword:`while` loop executes as long as the condition (here: ``a < " "10``) remains true. In Python, like in C, any non-zero integer value is " @@ -612,7 +620,7 @@ msgstr "" "``==``\\ (等於)、\\ ``<=``\\ (小於等於)、\\ ``>=``\\ (大於等於)以及 ``!" "=``\\ (不等於)。" -#: ../../tutorial/introduction.rst:506 +#: ../../tutorial/introduction.rst:513 msgid "" "The *body* of the loop is *indented*: indentation is Python's way of " "grouping statements. At the interactive prompt, you have to type a tab or " @@ -630,7 +638,7 @@ msgstr "" "析器無法判斷你何時輸入複合陳述的最後一行)。注意在一個縮排段落內的縮排方式與" "數量必須維持一致。" -#: ../../tutorial/introduction.rst:515 +#: ../../tutorial/introduction.rst:522 msgid "" "The :func:`print` function writes the value of the argument(s) it is given. " "It differs from just writing the expression you want to write (as we did " @@ -646,7 +654,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:526 +#: ../../tutorial/introduction.rst:533 msgid "" "The keyword argument *end* can be used to avoid the newline after the " "output, or end the output with a different string::" @@ -656,11 +664,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/introduction.rst:538 +#: ../../tutorial/introduction.rst:545 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/introduction.rst:539 +#: ../../tutorial/introduction.rst:546 msgid "" "Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted " "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " @@ -670,7 +678,7 @@ msgstr "" "得到 ``-9``\\ 。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``" "\\ 。" -#: ../../tutorial/introduction.rst:543 +#: ../../tutorial/introduction.rst:550 msgid "" "Unlike other languages, special characters such as ``\\n`` have the same " "meaning with both single (``'...'``) and double (``\"...\"``) quotes. The "