From d543f5b34caa343e56f1f7ee12e979dcbc48834e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 20 Feb 2022 06:01:43 +0000 Subject: [PATCH 1/4] sync with cpython ea3e0421 --- howto/descriptor.po | 201 +++++++++++++++++++++----------------------- 1 file changed, 98 insertions(+), 103 deletions(-) diff --git a/howto/descriptor.po b/howto/descriptor.po index c64e0a3621..de4536043e 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-20 00:08+0000\n" +"POT-Creation-Date: 2022-02-20 05:59+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -518,31 +518,26 @@ msgid "" "is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:700 +#: ../../howto/descriptor.rst:699 msgid "" -"Interestingly, attribute lookup doesn't call :meth:`object.__getattribute__` " -"directly. Instead, both the dot operator and the :func:`getattr` function " -"perform attribute lookup by way of a helper function:" +"Note, there is no :meth:`__getattr__` hook in the :meth:`__getattribute__` " +"code. That is why calling :meth:`__getattribute__` directly or with " +"``super().__getattribute__`` will bypass :meth:`__getattr__` entirely." msgstr "" -#: ../../howto/descriptor.rst:747 +#: ../../howto/descriptor.rst:703 msgid "" -"So if :meth:`__getattr__` exists, it is called whenever :meth:" -"`__getattribute__` raises :exc:`AttributeError` (either directly or in one " -"of the descriptor calls)." +"Instead, it is the dot operator and the :func:`getattr` function that are " +"responsible for invoking :meth:`__getattr__` whenever :meth:" +"`__getattribute__` raises an :exc:`AttributeError`. Their logic is " +"encapsulated in a helper function:" msgstr "" -#: ../../howto/descriptor.rst:750 -msgid "" -"Also, if a user calls :meth:`object.__getattribute__` directly, the :meth:" -"`__getattr__` hook is bypassed entirely." -msgstr "" - -#: ../../howto/descriptor.rst:755 +#: ../../howto/descriptor.rst:753 msgid "Invocation from a class" msgstr "" -#: ../../howto/descriptor.rst:757 +#: ../../howto/descriptor.rst:755 msgid "" "The logic for a dotted lookup such as ``A.x`` is in :meth:`type." "__getattribute__`. The steps are similar to those for :meth:`object." @@ -550,27 +545,27 @@ msgid "" "through the class's :term:`method resolution order`." msgstr "" -#: ../../howto/descriptor.rst:762 +#: ../../howto/descriptor.rst:760 msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." msgstr "" -#: ../../howto/descriptor.rst:764 +#: ../../howto/descriptor.rst:762 msgid "" "The full C implementation can be found in :c:func:`type_getattro()` and :c:" "func:`_PyType_Lookup()` in :source:`Objects/typeobject.c`." msgstr "" -#: ../../howto/descriptor.rst:769 +#: ../../howto/descriptor.rst:767 msgid "Invocation from super" msgstr "" -#: ../../howto/descriptor.rst:771 +#: ../../howto/descriptor.rst:769 msgid "" "The logic for super's dotted lookup is in the :meth:`__getattribute__` " "method for object returned by :class:`super()`." msgstr "" -#: ../../howto/descriptor.rst:774 +#: ../../howto/descriptor.rst:772 msgid "" "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." "__mro__`` for the base class ``B`` immediately following ``A`` and then " @@ -578,7 +573,7 @@ msgid "" "returned unchanged." msgstr "" -#: ../../howto/descriptor.rst:779 +#: ../../howto/descriptor.rst:777 msgid "" "The full C implementation can be found in :c:func:`super_getattro()` in :" "source:`Objects/typeobject.c`. A pure Python equivalent can be found in " @@ -586,37 +581,37 @@ msgid "" "#cooperation>`_." msgstr "" -#: ../../howto/descriptor.rst:786 +#: ../../howto/descriptor.rst:784 msgid "Summary of invocation logic" msgstr "" -#: ../../howto/descriptor.rst:788 +#: ../../howto/descriptor.rst:786 msgid "" "The mechanism for descriptors is embedded in the :meth:`__getattribute__()` " "methods for :class:`object`, :class:`type`, and :func:`super`." msgstr "" -#: ../../howto/descriptor.rst:791 +#: ../../howto/descriptor.rst:789 msgid "The important points to remember are:" msgstr "" -#: ../../howto/descriptor.rst:793 +#: ../../howto/descriptor.rst:791 msgid "Descriptors are invoked by the :meth:`__getattribute__` method." msgstr "" -#: ../../howto/descriptor.rst:795 +#: ../../howto/descriptor.rst:793 msgid "" "Classes inherit this machinery from :class:`object`, :class:`type`, or :func:" "`super`." msgstr "" -#: ../../howto/descriptor.rst:798 +#: ../../howto/descriptor.rst:796 msgid "" "Overriding :meth:`__getattribute__` prevents automatic descriptor calls " "because all the descriptor logic is in that method." msgstr "" -#: ../../howto/descriptor.rst:801 +#: ../../howto/descriptor.rst:799 msgid "" ":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make " "different calls to :meth:`__get__`. The first includes the instance and may " @@ -624,19 +619,19 @@ msgid "" "includes the class." msgstr "" -#: ../../howto/descriptor.rst:806 +#: ../../howto/descriptor.rst:804 msgid "Data descriptors always override instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:808 +#: ../../howto/descriptor.rst:806 msgid "Non-data descriptors may be overridden by instance dictionaries." msgstr "" -#: ../../howto/descriptor.rst:812 +#: ../../howto/descriptor.rst:810 msgid "Automatic name notification" msgstr "" -#: ../../howto/descriptor.rst:814 +#: ../../howto/descriptor.rst:812 msgid "" "Sometimes it is desirable for a descriptor to know what class variable name " "it was assigned to. When a new class is created, the :class:`type` " @@ -646,59 +641,59 @@ msgid "" "and the *name* is the class variable the descriptor was assigned to." msgstr "" -#: ../../howto/descriptor.rst:821 +#: ../../howto/descriptor.rst:819 msgid "" "The implementation details are in :c:func:`type_new()` and :c:func:" "`set_names()` in :source:`Objects/typeobject.c`." msgstr "" -#: ../../howto/descriptor.rst:824 +#: ../../howto/descriptor.rst:822 msgid "" "Since the update logic is in :meth:`type.__new__`, notifications only take " "place at the time of class creation. If descriptors are added to the class " "afterwards, :meth:`__set_name__` will need to be called manually." msgstr "" -#: ../../howto/descriptor.rst:830 +#: ../../howto/descriptor.rst:828 msgid "ORM example" msgstr "ORM 範例" -#: ../../howto/descriptor.rst:832 +#: ../../howto/descriptor.rst:830 msgid "" "The following code is simplified skeleton showing how data descriptors could " "be used to implement an `object relational mapping `_." msgstr "" -#: ../../howto/descriptor.rst:836 +#: ../../howto/descriptor.rst:834 msgid "" "The essential idea is that the data is stored in an external database. The " "Python instances only hold keys to the database's tables. Descriptors take " "care of lookups or updates:" msgstr "" -#: ../../howto/descriptor.rst:855 +#: ../../howto/descriptor.rst:853 msgid "" "We can use the :class:`Field` class to define `models `_ that describe the schema for each table in a " "database:" msgstr "" -#: ../../howto/descriptor.rst:880 +#: ../../howto/descriptor.rst:878 msgid "To use the models, first connect to the database::" msgstr "" -#: ../../howto/descriptor.rst:885 +#: ../../howto/descriptor.rst:883 msgid "" "An interactive session shows how data is retrieved from the database and how " "it can be updated:" msgstr "" -#: ../../howto/descriptor.rst:930 +#: ../../howto/descriptor.rst:928 msgid "Pure Python Equivalents" msgstr "" -#: ../../howto/descriptor.rst:932 +#: ../../howto/descriptor.rst:930 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -706,36 +701,36 @@ msgid "" "\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" -#: ../../howto/descriptor.rst:939 +#: ../../howto/descriptor.rst:937 msgid "Properties" msgstr "" -#: ../../howto/descriptor.rst:941 +#: ../../howto/descriptor.rst:939 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " "that triggers a function call upon access to an attribute. Its signature " "is::" msgstr "" -#: ../../howto/descriptor.rst:946 +#: ../../howto/descriptor.rst:944 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" -#: ../../howto/descriptor.rst:970 +#: ../../howto/descriptor.rst:968 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:1073 +#: ../../howto/descriptor.rst:1071 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1077 +#: ../../howto/descriptor.rst:1075 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -745,23 +740,23 @@ msgid "" "descriptor:" msgstr "" -#: ../../howto/descriptor.rst:1094 +#: ../../howto/descriptor.rst:1092 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" -#: ../../howto/descriptor.rst:1099 +#: ../../howto/descriptor.rst:1097 msgid "Functions and methods" msgstr "" -#: ../../howto/descriptor.rst:1101 +#: ../../howto/descriptor.rst:1099 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1104 +#: ../../howto/descriptor.rst:1102 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -769,13 +764,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1109 +#: ../../howto/descriptor.rst:1107 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: ../../howto/descriptor.rst:1126 +#: ../../howto/descriptor.rst:1124 msgid "" "To support automatic creation of methods, functions include the :meth:" "`__get__` method for binding methods during attribute access. This means " @@ -783,58 +778,58 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" -#: ../../howto/descriptor.rst:1142 +#: ../../howto/descriptor.rst:1140 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: ../../howto/descriptor.rst:1151 +#: ../../howto/descriptor.rst:1149 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: ../../howto/descriptor.rst:1158 +#: ../../howto/descriptor.rst:1156 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: ../../howto/descriptor.rst:1164 +#: ../../howto/descriptor.rst:1162 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" -#: ../../howto/descriptor.rst:1170 +#: ../../howto/descriptor.rst:1168 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" -#: ../../howto/descriptor.rst:1177 +#: ../../howto/descriptor.rst:1175 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: ../../howto/descriptor.rst:1186 +#: ../../howto/descriptor.rst:1184 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" msgstr "" -#: ../../howto/descriptor.rst:1191 +#: ../../howto/descriptor.rst:1189 msgid "Kinds of methods" msgstr "" -#: ../../howto/descriptor.rst:1193 +#: ../../howto/descriptor.rst:1191 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1196 +#: ../../howto/descriptor.rst:1194 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " @@ -842,55 +837,55 @@ msgid "" "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1201 +#: ../../howto/descriptor.rst:1199 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1204 +#: ../../howto/descriptor.rst:1202 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1204 +#: ../../howto/descriptor.rst:1202 msgid "Called from an object" msgstr "" -#: ../../howto/descriptor.rst:1204 +#: ../../howto/descriptor.rst:1202 msgid "Called from a class" msgstr "" -#: ../../howto/descriptor.rst:1207 +#: ../../howto/descriptor.rst:1205 msgid "function" msgstr "函式" -#: ../../howto/descriptor.rst:1207 +#: ../../howto/descriptor.rst:1205 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1207 ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1205 ../../howto/descriptor.rst:1207 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1207 msgid "staticmethod" msgstr "staticmethod" -#: ../../howto/descriptor.rst:1211 +#: ../../howto/descriptor.rst:1209 msgid "classmethod" msgstr "classmethod" -#: ../../howto/descriptor.rst:1211 +#: ../../howto/descriptor.rst:1209 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1211 +#: ../../howto/descriptor.rst:1209 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1216 +#: ../../howto/descriptor.rst:1214 msgid "Static methods" msgstr "" -#: ../../howto/descriptor.rst:1218 +#: ../../howto/descriptor.rst:1216 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -899,13 +894,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1224 +#: ../../howto/descriptor.rst:1222 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1227 +#: ../../howto/descriptor.rst:1225 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -917,30 +912,30 @@ msgid "" "``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" -#: ../../howto/descriptor.rst:1236 +#: ../../howto/descriptor.rst:1234 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: ../../howto/descriptor.rst:1253 +#: ../../howto/descriptor.rst:1251 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1292 +#: ../../howto/descriptor.rst:1290 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1294 +#: ../../howto/descriptor.rst:1292 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1312 +#: ../../howto/descriptor.rst:1310 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -949,17 +944,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1329 +#: ../../howto/descriptor.rst:1327 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1339 +#: ../../howto/descriptor.rst:1337 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1388 +#: ../../howto/descriptor.rst:1386 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -967,30 +962,30 @@ msgid "" "together:" msgstr "" -#: ../../howto/descriptor.rst:1408 +#: ../../howto/descriptor.rst:1406 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1410 +#: ../../howto/descriptor.rst:1408 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1414 +#: ../../howto/descriptor.rst:1412 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1430 +#: ../../howto/descriptor.rst:1428 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1465 +#: ../../howto/descriptor.rst:1463 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -998,19 +993,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1470 +#: ../../howto/descriptor.rst:1468 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1473 +#: ../../howto/descriptor.rst:1471 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1495 +#: ../../howto/descriptor.rst:1493 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1020,36 +1015,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1538 +#: ../../howto/descriptor.rst:1536 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1554 +#: ../../howto/descriptor.rst:1552 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1589 +#: ../../howto/descriptor.rst:1587 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1603 +#: ../../howto/descriptor.rst:1601 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1624 +#: ../../howto/descriptor.rst:1622 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1636 +#: ../../howto/descriptor.rst:1634 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" From 50de235097e3b62489d8312035f0f41a53aedfb2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 22 Feb 2022 00:14:08 +0000 Subject: [PATCH 2/4] sync with cpython c596ecbf --- library/ssl.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/ssl.po b/library/ssl.po index a8ca3d8fd2..aacb522692 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-03 00:08+0000\n" +"POT-Creation-Date: 2022-02-22 00:12+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-" @@ -1953,11 +1953,11 @@ msgstr "" msgid "" "Due to the early negotiation phase of the TLS connection, only limited " "methods and attributes are usable like :meth:`SSLSocket." -"selected_alpn_protocol` and :attr:`SSLSocket.context`. :meth:`SSLSocket." -"getpeercert`, :meth:`SSLSocket.getpeercert`, :meth:`SSLSocket.cipher` and :" -"meth:`SSLSocket.compress` methods require that the TLS connection has " -"progressed beyond the TLS Client Hello and therefore will not contain return " -"meaningful values nor can they be called safely." +"selected_alpn_protocol` and :attr:`SSLSocket.context`. The :meth:`SSLSocket." +"getpeercert`, :meth:`SSLSocket.cipher` and :meth:`SSLSocket.compression` " +"methods require that the TLS connection has progressed beyond the TLS Client " +"Hello and therefore will not return meaningful values nor can they be called " +"safely." msgstr "" #: ../../library/ssl.rst:1761 From deef16b2d536351a531a04dae98643f4a5497c05 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 23 Feb 2022 00:14:58 +0000 Subject: [PATCH 3/4] sync with cpython d327517b --- library/configparser.po | 302 ++++++++++++++++++++-------------------- using/windows.po | 5 +- 2 files changed, 157 insertions(+), 150 deletions(-) diff --git a/library/configparser.po b/library/configparser.po index 321bab94c3..74161a66b1 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-02-23 00:13+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-" @@ -195,27 +195,33 @@ msgstr "" #: ../../library/configparser.rst:270 msgid "" +"By default, a valid section name can be any string that does not contain '\\" +"\\n' or ']'. To change this, see :attr:`ConfigParser.SECTCRE`." +msgstr "" + +#: ../../library/configparser.rst:273 +msgid "" "Configuration files may include comments, prefixed by specific characters " "(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " "otherwise empty line, possibly indented. [1]_" msgstr "" -#: ../../library/configparser.rst:274 ../../library/configparser.rst:337 +#: ../../library/configparser.rst:277 ../../library/configparser.rst:340 msgid "For example:" msgstr "" -#: ../../library/configparser.rst:322 +#: ../../library/configparser.rst:325 msgid "Interpolation of values" msgstr "" -#: ../../library/configparser.rst:324 +#: ../../library/configparser.rst:327 msgid "" "On top of the core functionality, :class:`ConfigParser` supports " "interpolation. This means values can be preprocessed before returning them " "from ``get()`` calls." msgstr "" -#: ../../library/configparser.rst:332 +#: ../../library/configparser.rst:335 msgid "" "The default implementation used by :class:`ConfigParser`. It enables values " "to contain format strings which refer to other values in the same section, " @@ -223,7 +229,7 @@ msgid "" "can be provided on initialization." msgstr "" -#: ../../library/configparser.rst:349 +#: ../../library/configparser.rst:352 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -233,14 +239,14 @@ msgid "" "specific order in the configuration file." msgstr "" -#: ../../library/configparser.rst:356 +#: ../../library/configparser.rst:359 msgid "" "With ``interpolation`` set to ``None``, the parser would simply return ``" "%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" "lumberjack`` as the value of ``my_dir``." msgstr "" -#: ../../library/configparser.rst:364 +#: ../../library/configparser.rst:367 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -250,21 +256,21 @@ msgid "" "possibly the default values from the special section)." msgstr "" -#: ../../library/configparser.rst:371 +#: ../../library/configparser.rst:374 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" msgstr "" -#: ../../library/configparser.rst:384 +#: ../../library/configparser.rst:387 msgid "Values from other sections can be fetched as well:" msgstr "" -#: ../../library/configparser.rst:406 +#: ../../library/configparser.rst:409 msgid "Mapping Protocol Access" msgstr "" -#: ../../library/configparser.rst:410 +#: ../../library/configparser.rst:413 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:" @@ -272,7 +278,7 @@ msgid "" "``parser['section']['option']`` notation." msgstr "" -#: ../../library/configparser.rst:415 +#: ../../library/configparser.rst:418 msgid "" "``parser['section']`` in particular returns a proxy for the section's data " "in the parser. This means that the values are not copied but they are taken " @@ -281,7 +287,7 @@ msgid "" "original parser." msgstr "" -#: ../../library/configparser.rst:421 +#: ../../library/configparser.rst:424 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -289,7 +295,7 @@ msgid "" "that should be taken into account:" msgstr "" -#: ../../library/configparser.rst:426 +#: ../../library/configparser.rst:429 msgid "" "By default, all keys in sections are accessible in a case-insensitive manner " "[1]_. E.g. ``for option in parser[\"section\"]`` yields only " @@ -298,7 +304,7 @@ msgid "" "expressions return ``True``::" msgstr "" -#: ../../library/configparser.rst:434 +#: ../../library/configparser.rst:437 msgid "" "All sections include ``DEFAULTSECT`` values as well which means that ``." "clear()`` on a section may not leave the section visibly empty. This is " @@ -308,30 +314,30 @@ msgid "" "default value causes a :exc:`KeyError`." msgstr "" -#: ../../library/configparser.rst:441 +#: ../../library/configparser.rst:444 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "" -#: ../../library/configparser.rst:443 +#: ../../library/configparser.rst:446 msgid "trying to delete it raises :exc:`ValueError`," msgstr "" -#: ../../library/configparser.rst:445 +#: ../../library/configparser.rst:448 msgid "``parser.clear()`` leaves it intact," msgstr "" -#: ../../library/configparser.rst:447 +#: ../../library/configparser.rst:450 msgid "``parser.popitem()`` never returns it." msgstr "" -#: ../../library/configparser.rst:449 +#: ../../library/configparser.rst:452 msgid "" "``parser.get(section, option, **kwargs)`` - the second argument is **not** a " "fallback value. Note however that the section-level ``get()`` methods are " "compatible both with the mapping protocol and the classic configparser API." msgstr "" -#: ../../library/configparser.rst:453 +#: ../../library/configparser.rst:456 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -341,18 +347,18 @@ msgid "" "(unless ``raw=True`` is provided)." msgstr "" -#: ../../library/configparser.rst:460 +#: ../../library/configparser.rst:463 msgid "" "The mapping protocol is implemented on top of the existing legacy API so " "that subclasses overriding the original interface still should have mappings " "working as expected." msgstr "" -#: ../../library/configparser.rst:466 +#: ../../library/configparser.rst:469 msgid "Customizing Parser Behaviour" msgstr "" -#: ../../library/configparser.rst:468 +#: ../../library/configparser.rst:471 msgid "" "There are nearly as many INI format variants as there are applications using " "it. :mod:`configparser` goes a long way to provide support for the largest " @@ -361,17 +367,17 @@ msgid "" "customize some of the features." msgstr "" -#: ../../library/configparser.rst:474 +#: ../../library/configparser.rst:477 msgid "" "The most common way to change the way a specific config parser works is to " "use the :meth:`__init__` options:" msgstr "" -#: ../../library/configparser.rst:477 +#: ../../library/configparser.rst:480 msgid "*defaults*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:479 +#: ../../library/configparser.rst:482 msgid "" "This option accepts a dictionary of key-value pairs which will be initially " "put in the ``DEFAULT`` section. This makes for an elegant way to support " @@ -379,17 +385,17 @@ msgid "" "the documented default." msgstr "" -#: ../../library/configparser.rst:484 +#: ../../library/configparser.rst:487 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`read_dict` before you read the actual file." msgstr "" -#: ../../library/configparser.rst:487 +#: ../../library/configparser.rst:490 msgid "*dict_type*, default value: :class:`dict`" msgstr "" -#: ../../library/configparser.rst:489 +#: ../../library/configparser.rst:492 msgid "" "This option has a major impact on how the mapping protocol will behave and " "how the written configuration files look. With the standard dictionary, " @@ -397,24 +403,24 @@ msgid "" "goes for options within sections." msgstr "" -#: ../../library/configparser.rst:494 +#: ../../library/configparser.rst:497 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." msgstr "" -#: ../../library/configparser.rst:497 +#: ../../library/configparser.rst:500 msgid "" "Please note: there are ways to add a set of key-value pairs in a single " "operation. When you use a regular dictionary in those operations, the order " "of the keys will be ordered. For example:" msgstr "" -#: ../../library/configparser.rst:519 +#: ../../library/configparser.rst:522 msgid "*allow_no_value*, default value: ``False``" msgstr "" -#: ../../library/configparser.rst:521 +#: ../../library/configparser.rst:524 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`configparser`. The " @@ -422,32 +428,32 @@ msgid "" "such values should be accepted:" msgstr "" -#: ../../library/configparser.rst:556 +#: ../../library/configparser.rst:559 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "" -#: ../../library/configparser.rst:558 +#: ../../library/configparser.rst:561 msgid "" "Delimiters are substrings that delimit keys from values within a section. " "The first occurrence of a delimiting substring on a line is considered a " "delimiter. This means values (but not keys) can contain the delimiters." msgstr "" -#: ../../library/configparser.rst:562 +#: ../../library/configparser.rst:565 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." msgstr "" -#: ../../library/configparser.rst:565 +#: ../../library/configparser.rst:568 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "" -#: ../../library/configparser.rst:567 +#: ../../library/configparser.rst:570 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:569 +#: ../../library/configparser.rst:572 msgid "" "Comment prefixes are strings that indicate the start of a valid comment " "within a config file. *comment_prefixes* are used only on otherwise empty " @@ -457,13 +463,13 @@ msgid "" "used as prefixes for whole line comments." msgstr "" -#: ../../library/configparser.rst:576 +#: ../../library/configparser.rst:579 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" -#: ../../library/configparser.rst:580 +#: ../../library/configparser.rst:583 msgid "" "Please note that config parsers don't support escaping of comment prefixes " "so using *inline_comment_prefixes* may prevent users from specifying option " @@ -473,11 +479,11 @@ msgid "" "values is to interpolate the prefix, for example::" msgstr "" -#: ../../library/configparser.rst:626 +#: ../../library/configparser.rst:629 msgid "*strict*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:628 +#: ../../library/configparser.rst:631 msgid "" "When set to ``True``, the parser will not allow for any section or option " "duplicates while reading from a single source (using :meth:`read_file`, :" @@ -485,17 +491,17 @@ msgid "" "parsers in new applications." msgstr "" -#: ../../library/configparser.rst:633 +#: ../../library/configparser.rst:636 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." msgstr "" -#: ../../library/configparser.rst:637 +#: ../../library/configparser.rst:640 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:639 +#: ../../library/configparser.rst:642 msgid "" "In config parsers, values can span multiple lines as long as they are " "indented more than the key that holds them. By default parsers also let " @@ -505,7 +511,7 @@ msgid "" "lose track of the file structure. Take for instance:" msgstr "" -#: ../../library/configparser.rst:654 +#: ../../library/configparser.rst:657 msgid "" "This can be especially problematic for the user to see if she's using a " "proportional font to edit the file. That is why when your application does " @@ -514,13 +520,13 @@ msgid "" "would produce two keys, ``key`` and ``this``." msgstr "" -#: ../../library/configparser.rst:660 +#: ../../library/configparser.rst:663 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: ``" "\"DEFAULT\"``)" msgstr "" -#: ../../library/configparser.rst:663 +#: ../../library/configparser.rst:666 msgid "" "The convention of allowing a special section of default values for other " "sections or interpolation purposes is a powerful concept of this library, " @@ -534,11 +540,11 @@ msgid "" "files from one format to another)." msgstr "" -#: ../../library/configparser.rst:674 +#: ../../library/configparser.rst:677 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "" -#: ../../library/configparser.rst:676 +#: ../../library/configparser.rst:679 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -548,11 +554,11 @@ msgid "" "`RawConfigParser` has a default value of ``None``." msgstr "" -#: ../../library/configparser.rst:683 +#: ../../library/configparser.rst:686 msgid "*converters*, default value: not set" msgstr "" -#: ../../library/configparser.rst:685 +#: ../../library/configparser.rst:688 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -566,7 +572,7 @@ msgid "" "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" -#: ../../library/configparser.rst:696 +#: ../../library/configparser.rst:699 msgid "" "If the converter needs to access the state of the parser, it can be " "implemented as a method on a config parser subclass. If the name of this " @@ -574,14 +580,14 @@ msgid "" "the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" -#: ../../library/configparser.rst:701 +#: ../../library/configparser.rst:704 msgid "" "More advanced customization may be achieved by overriding default values of " "these parser attributes. The defaults are defined on the classes, so they " "may be overridden by subclasses or by attribute assignment." msgstr "" -#: ../../library/configparser.rst:707 +#: ../../library/configparser.rst:710 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -590,13 +596,13 @@ msgid "" "strings and their Boolean outcomes. For example:" msgstr "" -#: ../../library/configparser.rst:725 +#: ../../library/configparser.rst:728 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." msgstr "" -#: ../../library/configparser.rst:731 +#: ../../library/configparser.rst:734 msgid "" "This method transforms option names on every read, get, or set operation. " "The default converts the name to lowercase. This also means that when a " @@ -604,14 +610,14 @@ msgid "" "method if that's unsuitable. For example:" msgstr "" -#: ../../library/configparser.rst:761 +#: ../../library/configparser.rst:764 msgid "" "The optionxform function transforms option names to a canonical form. This " "should be an idempotent function: if the name is already in canonical form, " "it should be returned unchanged." msgstr "" -#: ../../library/configparser.rst:768 +#: ../../library/configparser.rst:771 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -620,18 +626,18 @@ msgid "" "example:" msgstr "" -#: ../../library/configparser.rst:796 +#: ../../library/configparser.rst:799 msgid "" "While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " "option lines, it's not recommended to override it because that would " "interfere with constructor options *allow_no_value* and *delimiters*." msgstr "" -#: ../../library/configparser.rst:802 +#: ../../library/configparser.rst:805 msgid "Legacy API Examples" msgstr "" -#: ../../library/configparser.rst:804 +#: ../../library/configparser.rst:807 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -640,29 +646,29 @@ msgid "" "advanced, low-level and downright counterintuitive." msgstr "" -#: ../../library/configparser.rst:810 +#: ../../library/configparser.rst:813 msgid "An example of writing to a configuration file::" msgstr "" -#: ../../library/configparser.rst:833 +#: ../../library/configparser.rst:836 msgid "An example of reading the configuration file again::" msgstr "" -#: ../../library/configparser.rst:851 +#: ../../library/configparser.rst:854 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "" -#: ../../library/configparser.rst:884 +#: ../../library/configparser.rst:887 msgid "" "Default values are available in both types of ConfigParsers. They are used " "in interpolation if an option used is not defined elsewhere. ::" msgstr "" -#: ../../library/configparser.rst:902 +#: ../../library/configparser.rst:905 msgid "ConfigParser Objects" msgstr "ConfigParser 物件" -#: ../../library/configparser.rst:906 +#: ../../library/configparser.rst:909 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -670,7 +676,7 @@ msgid "" "the options within a section, and for the default values." msgstr "" -#: ../../library/configparser.rst:911 +#: ../../library/configparser.rst:914 msgid "" "When *delimiters* is given, it is used as the set of substrings that divide " "keys from values. When *comment_prefixes* is given, it will be used as the " @@ -679,7 +685,7 @@ msgid "" "as the set of substrings that prefix comments in non-empty lines." msgstr "" -#: ../../library/configparser.rst:917 +#: ../../library/configparser.rst:920 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -692,7 +698,7 @@ msgid "" "without the trailing delimiter." msgstr "" -#: ../../library/configparser.rst:927 +#: ../../library/configparser.rst:930 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -700,7 +706,7 @@ msgid "" "on runtime using the ``default_section`` instance attribute." msgstr "" -#: ../../library/configparser.rst:932 +#: ../../library/configparser.rst:935 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -709,7 +715,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:938 +#: ../../library/configparser.rst:941 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -718,7 +724,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:944 +#: ../../library/configparser.rst:947 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -727,44 +733,44 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:950 +#: ../../library/configparser.rst:953 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:953 +#: ../../library/configparser.rst:956 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:958 +#: ../../library/configparser.rst:961 msgid "The *converters* argument was added." msgstr "新增 *converters* 引數。" -#: ../../library/configparser.rst:961 +#: ../../library/configparser.rst:964 msgid "" "The *defaults* argument is read with :meth:`read_dict()`, providing " "consistent behavior across the parser: non-string keys and values are " "implicitly converted to strings." msgstr "" -#: ../../library/configparser.rst:966 ../../library/configparser.rst:1251 +#: ../../library/configparser.rst:969 ../../library/configparser.rst:1254 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:972 +#: ../../library/configparser.rst:975 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:977 +#: ../../library/configparser.rst:980 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:983 +#: ../../library/configparser.rst:986 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -772,34 +778,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:988 +#: ../../library/configparser.rst:991 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:994 +#: ../../library/configparser.rst:997 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:1000 +#: ../../library/configparser.rst:1003 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:1005 +#: ../../library/configparser.rst:1008 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:1012 +#: ../../library/configparser.rst:1015 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:1015 +#: ../../library/configparser.rst:1018 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -810,7 +816,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:1024 +#: ../../library/configparser.rst:1027 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -818,49 +824,49 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1037 +#: ../../library/configparser.rst:1040 msgid "" "The *encoding* parameter. Previously, all files were read using the default " "encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1041 +#: ../../library/configparser.rst:1044 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1044 +#: ../../library/configparser.rst:1047 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1050 +#: ../../library/configparser.rst:1053 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1053 +#: ../../library/configparser.rst:1056 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1057 +#: ../../library/configparser.rst:1060 msgid "Replaces :meth:`readfp`." msgstr "" -#: ../../library/configparser.rst:1062 +#: ../../library/configparser.rst:1065 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1064 +#: ../../library/configparser.rst:1067 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1073 +#: ../../library/configparser.rst:1076 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -869,17 +875,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1079 +#: ../../library/configparser.rst:1082 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1082 +#: ../../library/configparser.rst:1085 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1089 +#: ../../library/configparser.rst:1092 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -888,35 +894,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1095 +#: ../../library/configparser.rst:1098 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1099 +#: ../../library/configparser.rst:1102 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1107 +#: ../../library/configparser.rst:1110 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1114 +#: ../../library/configparser.rst:1117 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1121 +#: ../../library/configparser.rst:1124 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -928,34 +934,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1134 +#: ../../library/configparser.rst:1137 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1137 +#: ../../library/configparser.rst:1140 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1141 +#: ../../library/configparser.rst:1144 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1149 +#: ../../library/configparser.rst:1152 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1156 +#: ../../library/configparser.rst:1159 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -964,27 +970,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1164 +#: ../../library/configparser.rst:1167 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1172 +#: ../../library/configparser.rst:1175 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1180 +#: ../../library/configparser.rst:1183 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1186 +#: ../../library/configparser.rst:1189 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -993,7 +999,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1192 +#: ../../library/configparser.rst:1195 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1001,46 +1007,46 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1200 +#: ../../library/configparser.rst:1203 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1206 +#: ../../library/configparser.rst:1209 msgid "Use :meth:`read_file` instead." msgstr "" -#: ../../library/configparser.rst:1209 +#: ../../library/configparser.rst:1212 msgid "" ":meth:`readfp` now iterates on *fp* instead of calling ``fp.readline()``." msgstr "" -#: ../../library/configparser.rst:1212 +#: ../../library/configparser.rst:1215 msgid "" "For existing code calling :meth:`readfp` with arguments which don't support " "iteration, the following generator may be used as a wrapper around the file-" "like object::" msgstr "" -#: ../../library/configparser.rst:1222 +#: ../../library/configparser.rst:1225 msgid "" "Instead of ``parser.readfp(fp)`` use ``parser." "read_file(readline_generator(fp))``." msgstr "" -#: ../../library/configparser.rst:1228 +#: ../../library/configparser.rst:1231 msgid "" "The maximum depth for recursive interpolation for :meth:`get` when the *raw* " "parameter is false. This is relevant only when the default *interpolation* " "is used." msgstr "" -#: ../../library/configparser.rst:1236 +#: ../../library/configparser.rst:1239 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1246 +#: ../../library/configparser.rst:1249 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1048,27 +1054,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1256 +#: ../../library/configparser.rst:1259 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1263 +#: ../../library/configparser.rst:1266 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1267 +#: ../../library/configparser.rst:1270 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1273 +#: ../../library/configparser.rst:1276 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1078,7 +1084,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1280 +#: ../../library/configparser.rst:1283 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1086,32 +1092,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1287 +#: ../../library/configparser.rst:1290 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1291 +#: ../../library/configparser.rst:1294 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1296 +#: ../../library/configparser.rst:1299 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1301 +#: ../../library/configparser.rst:1304 msgid "" "Exception raised if :meth:`add_section` is called with the name of a section " "that is already present or in strict parsers when a section if found more " "than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1305 +#: ../../library/configparser.rst:1308 msgid "" "Optional ``source`` and ``lineno`` attributes and arguments to :meth:" "`__init__` were added." msgstr "" -#: ../../library/configparser.rst:1312 +#: ../../library/configparser.rst:1315 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1119,58 +1125,58 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1320 +#: ../../library/configparser.rst:1323 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1326 +#: ../../library/configparser.rst:1329 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1332 +#: ../../library/configparser.rst:1335 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1339 +#: ../../library/configparser.rst:1342 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1345 +#: ../../library/configparser.rst:1348 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1351 +#: ../../library/configparser.rst:1354 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1357 +#: ../../library/configparser.rst:1360 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1359 +#: ../../library/configparser.rst:1362 msgid "" "The ``filename`` attribute and :meth:`__init__` argument were renamed to " "``source`` for consistency." msgstr "" -#: ../../library/configparser.rst:1365 +#: ../../library/configparser.rst:1368 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1366 +#: ../../library/configparser.rst:1369 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " diff --git a/using/windows.po b/using/windows.po index d3cbee74d3..a60523e6de 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-02-23 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -235,7 +235,8 @@ msgid "" "To completely hide the installer UI and install Python silently, pass the ``/" "quiet`` option. To skip past the user interaction but still display progress " "and errors, pass the ``/passive`` option. The ``/uninstall`` option may be " -"passed to immediately begin removing Python - no prompt will be displayed." +"passed to immediately begin removing Python - no confirmation prompt will be " +"displayed." msgstr "" #: ../../using/windows.rst:135 From 6a45f53df61637d02dc0f47e008707146399d8b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Feb 2022 00:14:12 +0000 Subject: [PATCH 4/4] sync with cpython b0de6299 --- c-api/exceptions.po | 499 ++++++++++++++++++++++---------------------- c-api/typeobj.po | 112 +++++----- c-api/unicode.po | 16 +- c-api/veryhigh.po | 95 ++++----- 4 files changed, 365 insertions(+), 357 deletions(-) diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 1ed7177575..0c85b440ae 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-02-24 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -280,25 +280,31 @@ msgstr "" #: ../../c-api/exceptions.rst:258 msgid "" +"Much like :c:func:`PyErr_SetImportError` but this function allows for " +"specifying a subclass of :exc:`ImportError` to raise." +msgstr "" + +#: ../../c-api/exceptions.rst:266 +msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " "attributes, which make the exception printing subsystem think the exception " "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:268 +#: ../../c-api/exceptions.rst:276 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:276 +#: ../../c-api/exceptions.rst:284 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the col_offset parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:282 +#: ../../c-api/exceptions.rst:290 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -306,11 +312,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:289 +#: ../../c-api/exceptions.rst:297 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:291 +#: ../../c-api/exceptions.rst:299 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -326,7 +332,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:306 +#: ../../c-api/exceptions.rst:314 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -336,7 +342,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:313 +#: ../../c-api/exceptions.rst:321 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -345,20 +351,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:319 +#: ../../c-api/exceptions.rst:327 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:325 -msgid "" -"Much like :c:func:`PyErr_SetImportError` but this function allows for " -"specifying a subclass of :exc:`ImportError` to raise." -msgstr "" - -#: ../../c-api/exceptions.rst:333 +#: ../../c-api/exceptions.rst:334 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -366,31 +366,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:344 +#: ../../c-api/exceptions.rst:345 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:351 +#: ../../c-api/exceptions.rst:352 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:360 +#: ../../c-api/exceptions.rst:361 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:367 +#: ../../c-api/exceptions.rst:368 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:371 +#: ../../c-api/exceptions.rst:372 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the :c:func:`PyErr_Set" @@ -399,11 +399,11 @@ msgid "" "need to :c:func:`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:377 +#: ../../c-api/exceptions.rst:378 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:381 +#: ../../c-api/exceptions.rst:382 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -411,14 +411,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:389 +#: ../../c-api/exceptions.rst:390 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:396 +#: ../../c-api/exceptions.rst:397 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -426,7 +426,7 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:404 +#: ../../c-api/exceptions.rst:405 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -435,14 +435,14 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:411 +#: ../../c-api/exceptions.rst:412 msgid "" "This function is normally only used by code that needs to catch exceptions " "or by code that needs to save and restore the error indicator temporarily, e." "g.::" msgstr "" -#: ../../c-api/exceptions.rst:426 +#: ../../c-api/exceptions.rst:427 msgid "" "Set the error indicator from the three objects. If the error indicator is " "already set, it is cleared first. If the objects are ``NULL``, the error " @@ -455,14 +455,14 @@ msgid "" "function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:438 +#: ../../c-api/exceptions.rst:439 msgid "" "This function is normally only used by code that needs to save and restore " "the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save the " "current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:445 +#: ../../c-api/exceptions.rst:446 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -472,14 +472,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:453 +#: ../../c-api/exceptions.rst:454 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:464 +#: ../../c-api/exceptions.rst:465 msgid "" "Retrieve the exception info, as known from ``sys.exc_info()``. This refers " "to an exception that was *already caught*, not to an exception that was " @@ -487,7 +487,7 @@ msgid "" "may be ``NULL``. Does not modify the exception info state." msgstr "" -#: ../../c-api/exceptions.rst:471 +#: ../../c-api/exceptions.rst:472 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -495,7 +495,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:481 +#: ../../c-api/exceptions.rst:482 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -504,7 +504,7 @@ msgid "" "about the three arguments, see :c:func:`PyErr_Restore`." msgstr "" -#: ../../c-api/exceptions.rst:489 +#: ../../c-api/exceptions.rst:490 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -512,15 +512,15 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:498 +#: ../../c-api/exceptions.rst:499 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:508 +#: ../../c-api/exceptions.rst:509 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:510 +#: ../../c-api/exceptions.rst:511 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -528,7 +528,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:515 +#: ../../c-api/exceptions.rst:516 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -537,44 +537,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:521 +#: ../../c-api/exceptions.rst:522 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:524 +#: ../../c-api/exceptions.rst:525 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:528 +#: ../../c-api/exceptions.rst:529 msgid "" "The default Python signal handler for :const:`SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:539 +#: ../../c-api/exceptions.rst:540 msgid "" "Simulate the effect of a :const:`SIGINT` signal arriving. This is equivalent " "to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:543 ../../c-api/exceptions.rst:570 +#: ../../c-api/exceptions.rst:544 ../../c-api/exceptions.rst:571 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:553 +#: ../../c-api/exceptions.rst:554 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:557 +#: ../../c-api/exceptions.rst:558 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -582,27 +582,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:562 +#: ../../c-api/exceptions.rst:563 msgid "" "If the given signal isn't handled by Python (it was set to :data:`signal." "SIG_DFL` or :data:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:565 +#: ../../c-api/exceptions.rst:566 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:578 +#: ../../c-api/exceptions.rst:579 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:582 +#: ../../c-api/exceptions.rst:583 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -610,15 +610,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:587 +#: ../../c-api/exceptions.rst:588 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:592 +#: ../../c-api/exceptions.rst:593 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:596 +#: ../../c-api/exceptions.rst:597 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -627,7 +627,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:602 +#: ../../c-api/exceptions.rst:603 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -637,31 +637,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:611 +#: ../../c-api/exceptions.rst:612 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:619 +#: ../../c-api/exceptions.rst:620 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:623 +#: ../../c-api/exceptions.rst:624 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:630 +#: ../../c-api/exceptions.rst:631 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:636 +#: ../../c-api/exceptions.rst:637 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -669,127 +669,127 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:644 +#: ../../c-api/exceptions.rst:645 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:651 +#: ../../c-api/exceptions.rst:652 msgid "" "Return the cause (either an exception instance, or :const:`None`, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:658 +#: ../../c-api/exceptions.rst:659 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or :const:`None`. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:662 +#: ../../c-api/exceptions.rst:663 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:668 +#: ../../c-api/exceptions.rst:669 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:670 +#: ../../c-api/exceptions.rst:671 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:674 +#: ../../c-api/exceptions.rst:675 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:680 +#: ../../c-api/exceptions.rst:681 msgid "" "Create a :class:`UnicodeEncodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:684 ../../c-api/exceptions.rst:694 +#: ../../c-api/exceptions.rst:685 ../../c-api/exceptions.rst:695 msgid "3.11" msgstr "3.11" -#: ../../c-api/exceptions.rst:686 +#: ../../c-api/exceptions.rst:687 msgid "" "``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to " "``PyObject_CallFunction(PyExc_UnicodeEncodeError, \"sOnns\", ...)``." msgstr "" -#: ../../c-api/exceptions.rst:691 +#: ../../c-api/exceptions.rst:692 msgid "" "Create a :class:`UnicodeTranslateError` object with the attributes *object*, " "*length*, *start*, *end* and *reason*. *reason* is a UTF-8 encoded string." msgstr "" -#: ../../c-api/exceptions.rst:696 +#: ../../c-api/exceptions.rst:697 msgid "" "``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to " "``PyObject_CallFunction(PyExc_UnicodeTranslateError, \"Onns\", ...)``." msgstr "" -#: ../../c-api/exceptions.rst:702 +#: ../../c-api/exceptions.rst:703 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:708 +#: ../../c-api/exceptions.rst:709 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:714 +#: ../../c-api/exceptions.rst:715 msgid "" "Get the *start* attribute of the given exception object and place it into *" "\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:722 +#: ../../c-api/exceptions.rst:723 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:729 +#: ../../c-api/exceptions.rst:730 msgid "" "Get the *end* attribute of the given exception object and place it into *" "\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:737 +#: ../../c-api/exceptions.rst:738 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:744 +#: ../../c-api/exceptions.rst:745 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:750 +#: ../../c-api/exceptions.rst:751 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:757 +#: ../../c-api/exceptions.rst:758 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:759 +#: ../../c-api/exceptions.rst:760 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -799,42 +799,42 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:768 +#: ../../c-api/exceptions.rst:769 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:770 +#: ../../c-api/exceptions.rst:771 msgid "" "If :const:`USE_STACKCHECK` is defined, this function checks if the OS stack " "overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it sets a :" "exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:774 +#: ../../c-api/exceptions.rst:775 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:778 +#: ../../c-api/exceptions.rst:779 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:782 ../../c-api/exceptions.rst:790 +#: ../../c-api/exceptions.rst:783 ../../c-api/exceptions.rst:791 msgid "This function is now also available in the limited API." msgstr "" -#: ../../c-api/exceptions.rst:787 +#: ../../c-api/exceptions.rst:788 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:793 +#: ../../c-api/exceptions.rst:794 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -843,13 +843,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:801 +#: ../../c-api/exceptions.rst:802 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:804 +#: ../../c-api/exceptions.rst:805 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -857,30 +857,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:810 +#: ../../c-api/exceptions.rst:811 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:814 +#: ../../c-api/exceptions.rst:815 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:819 +#: ../../c-api/exceptions.rst:820 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:826 +#: ../../c-api/exceptions.rst:827 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:828 +#: ../../c-api/exceptions.rst:829 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -888,455 +888,455 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:889 ../../c-api/exceptions.rst:1022 -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1068 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:889 ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:1068 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:889 ../../c-api/exceptions.rst:1022 -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1068 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:891 +#: ../../c-api/exceptions.rst:892 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:891 +#: ../../c-api/exceptions.rst:892 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:891 ../../c-api/exceptions.rst:893 -#: ../../c-api/exceptions.rst:895 ../../c-api/exceptions.rst:941 -#: ../../c-api/exceptions.rst:953 ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:892 ../../c-api/exceptions.rst:894 +#: ../../c-api/exceptions.rst:896 ../../c-api/exceptions.rst:942 +#: ../../c-api/exceptions.rst:954 ../../c-api/exceptions.rst:1070 msgid "\\(1)" msgstr "\\(1)" -#: ../../c-api/exceptions.rst:893 +#: ../../c-api/exceptions.rst:894 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:893 +#: ../../c-api/exceptions.rst:894 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:896 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:896 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:898 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:898 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:900 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:900 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:902 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:902 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:903 +#: ../../c-api/exceptions.rst:904 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:903 +#: ../../c-api/exceptions.rst:904 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:905 +#: ../../c-api/exceptions.rst:906 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:905 +#: ../../c-api/exceptions.rst:906 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:907 +#: ../../c-api/exceptions.rst:908 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:907 +#: ../../c-api/exceptions.rst:908 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:909 +#: ../../c-api/exceptions.rst:910 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:909 +#: ../../c-api/exceptions.rst:910 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:912 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:912 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:914 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:914 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:915 +#: ../../c-api/exceptions.rst:916 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:915 +#: ../../c-api/exceptions.rst:916 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:917 +#: ../../c-api/exceptions.rst:918 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:917 +#: ../../c-api/exceptions.rst:918 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:919 +#: ../../c-api/exceptions.rst:920 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:919 +#: ../../c-api/exceptions.rst:920 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:921 +#: ../../c-api/exceptions.rst:922 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:921 +#: ../../c-api/exceptions.rst:922 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:923 +#: ../../c-api/exceptions.rst:924 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:923 +#: ../../c-api/exceptions.rst:924 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:925 +#: ../../c-api/exceptions.rst:926 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:925 +#: ../../c-api/exceptions.rst:926 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:927 +#: ../../c-api/exceptions.rst:928 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:927 +#: ../../c-api/exceptions.rst:928 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:929 +#: ../../c-api/exceptions.rst:930 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:929 +#: ../../c-api/exceptions.rst:930 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:932 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:932 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:933 +#: ../../c-api/exceptions.rst:934 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:933 +#: ../../c-api/exceptions.rst:934 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:935 +#: ../../c-api/exceptions.rst:936 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:935 +#: ../../c-api/exceptions.rst:936 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:937 +#: ../../c-api/exceptions.rst:938 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:937 +#: ../../c-api/exceptions.rst:938 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:939 +#: ../../c-api/exceptions.rst:940 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:939 +#: ../../c-api/exceptions.rst:940 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:942 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:942 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:943 +#: ../../c-api/exceptions.rst:944 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:943 +#: ../../c-api/exceptions.rst:944 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:946 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:946 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:947 +#: ../../c-api/exceptions.rst:948 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:947 +#: ../../c-api/exceptions.rst:948 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:949 +#: ../../c-api/exceptions.rst:950 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:949 +#: ../../c-api/exceptions.rst:950 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:951 +#: ../../c-api/exceptions.rst:952 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:951 +#: ../../c-api/exceptions.rst:952 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:953 +#: ../../c-api/exceptions.rst:954 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:953 +#: ../../c-api/exceptions.rst:954 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:955 +#: ../../c-api/exceptions.rst:956 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:955 +#: ../../c-api/exceptions.rst:956 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:957 +#: ../../c-api/exceptions.rst:958 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:957 +#: ../../c-api/exceptions.rst:958 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:959 +#: ../../c-api/exceptions.rst:960 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:959 +#: ../../c-api/exceptions.rst:960 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:961 +#: ../../c-api/exceptions.rst:962 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:961 +#: ../../c-api/exceptions.rst:962 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:963 +#: ../../c-api/exceptions.rst:964 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:963 +#: ../../c-api/exceptions.rst:964 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:963 +#: ../../c-api/exceptions.rst:964 msgid "\\(2)" msgstr "\\(2)" -#: ../../c-api/exceptions.rst:965 +#: ../../c-api/exceptions.rst:966 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:965 +#: ../../c-api/exceptions.rst:966 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:967 +#: ../../c-api/exceptions.rst:968 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:967 +#: ../../c-api/exceptions.rst:968 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:969 +#: ../../c-api/exceptions.rst:970 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:969 +#: ../../c-api/exceptions.rst:970 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:971 +#: ../../c-api/exceptions.rst:972 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:971 +#: ../../c-api/exceptions.rst:972 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:973 +#: ../../c-api/exceptions.rst:974 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:973 +#: ../../c-api/exceptions.rst:974 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:975 +#: ../../c-api/exceptions.rst:976 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:975 +#: ../../c-api/exceptions.rst:976 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:977 +#: ../../c-api/exceptions.rst:978 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:977 +#: ../../c-api/exceptions.rst:978 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:979 +#: ../../c-api/exceptions.rst:980 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:979 +#: ../../c-api/exceptions.rst:980 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:981 +#: ../../c-api/exceptions.rst:982 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:981 +#: ../../c-api/exceptions.rst:982 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:983 +#: ../../c-api/exceptions.rst:984 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:983 +#: ../../c-api/exceptions.rst:984 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:985 +#: ../../c-api/exceptions.rst:986 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:985 +#: ../../c-api/exceptions.rst:986 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:987 +#: ../../c-api/exceptions.rst:988 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:987 +#: ../../c-api/exceptions.rst:988 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:989 +#: ../../c-api/exceptions.rst:990 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:989 +#: ../../c-api/exceptions.rst:990 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:991 +#: ../../c-api/exceptions.rst:992 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:991 +#: ../../c-api/exceptions.rst:992 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:993 +#: ../../c-api/exceptions.rst:994 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:993 +#: ../../c-api/exceptions.rst:994 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:995 +#: ../../c-api/exceptions.rst:996 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:995 +#: ../../c-api/exceptions.rst:996 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:998 +#: ../../c-api/exceptions.rst:999 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1356,57 +1356,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1008 +#: ../../c-api/exceptions.rst:1009 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." -msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" +msgstr "" +":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1012 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1014 +#: ../../c-api/exceptions.rst:1015 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1024 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1026 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1028 +#: ../../c-api/exceptions.rst:1029 msgid "\\(3)" msgstr "\\(3)" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1032 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1034 ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1035 ../../c-api/exceptions.rst:1096 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1038 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1040 +#: ../../c-api/exceptions.rst:1041 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1046 +#: ../../c-api/exceptions.rst:1047 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1048 +#: ../../c-api/exceptions.rst:1049 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1414,98 +1415,98 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1070 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1070 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1072 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1072 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1074 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1074 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1076 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1076 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1078 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1078 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1080 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1080 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1082 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1082 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1084 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1084 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1086 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1086 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1088 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1088 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1090 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1090 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1092 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1098 +#: ../../c-api/exceptions.rst:1099 msgid "This is a base class for other standard warning categories." msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 0a12951a75..6e4c6009ec 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-23 00:09+0000\n" +"POT-Creation-Date: 2022-02-24 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1145,11 +1145,10 @@ msgstr "" #: ../../c-api/typeobj.rst:478 msgid "" "The type object structure extends the :c:type:`PyVarObject` structure. The :" -"attr:`ob_size` field is used for dynamic types (created by :func:" -"`type_new`, usually called from a class statement). Note that :c:data:" -"`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject." -"tp_itemsize`, which means that its instances (i.e. type objects) *must* have " -"the :attr:`ob_size` field." +"attr:`ob_size` field is used for dynamic types (created by :func:`type_new`, " +"usually called from a class statement). Note that :c:data:`PyType_Type` (the " +"metatype) initializes :c:member:`~PyTypeObject.tp_itemsize`, which means " +"that its instances (i.e. type objects) *must* have the :attr:`ob_size` field." msgstr "" #: ../../c-api/typeobj.rst:487 @@ -1192,7 +1191,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1910 ../../c-api/typeobj.rst:1921 #: ../../c-api/typeobj.rst:1931 ../../c-api/typeobj.rst:1940 #: ../../c-api/typeobj.rst:1950 ../../c-api/typeobj.rst:1964 -#: ../../c-api/typeobj.rst:2002 ../../c-api/typeobj.rst:2019 +#: ../../c-api/typeobj.rst:2013 ../../c-api/typeobj.rst:2030 msgid "**Inheritance:**" msgstr "" @@ -1226,7 +1225,7 @@ msgstr "" #: ../../c-api/typeobj.rst:934 ../../c-api/typeobj.rst:1533 #: ../../c-api/typeobj.rst:1556 ../../c-api/typeobj.rst:1674 #: ../../c-api/typeobj.rst:1692 ../../c-api/typeobj.rst:1783 -#: ../../c-api/typeobj.rst:1895 ../../c-api/typeobj.rst:2004 +#: ../../c-api/typeobj.rst:1895 ../../c-api/typeobj.rst:2015 msgid "This field is inherited by subtypes." msgstr "" @@ -2879,11 +2878,24 @@ msgid "" "also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit." msgstr "" -#: ../../c-api/typeobj.rst:2008 +#: ../../c-api/typeobj.rst:2002 +msgid "" +"Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." +"tp_dealloc` may be called from any Python thread, not just the thread which " +"created the object (if the object becomes part of a refcount cycle, that " +"cycle might be collected by a garbage collection on any thread). This is " +"not a problem for Python API calls, since the thread on which tp_dealloc is " +"called will own the Global Interpreter Lock (GIL). However, if the object " +"being destroyed in turn destroys objects from some other C or C++ library, " +"care should be taken to ensure that destroying those objects on the thread " +"which called tp_dealloc will not violate any assumptions of the library." +msgstr "" + +#: ../../c-api/typeobj.rst:2019 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: ../../c-api/typeobj.rst:2013 +#: ../../c-api/typeobj.rst:2024 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -2891,27 +2903,14 @@ msgid "" "attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2021 +#: ../../c-api/typeobj.rst:2032 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2023 +#: ../../c-api/typeobj.rst:2034 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2026 -msgid "" -"Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." -"tp_dealloc` may be called from any Python thread, not just the thread which " -"created the object (if the object becomes part of a refcount cycle, that " -"cycle might be collected by a garbage collection on any thread). This is " -"not a problem for Python API calls, since the thread on which tp_dealloc is " -"called will own the Global Interpreter Lock (GIL). However, if the object " -"being destroyed in turn destroys objects from some other C or C++ library, " -"care should be taken to ensure that destroying those objects on the thread " -"which called tp_dealloc will not violate any assumptions of the library." -msgstr "" - #: ../../c-api/typeobj.rst:2040 msgid "Static Types" msgstr "" @@ -3137,7 +3136,7 @@ msgstr "" #: ../../c-api/typeobj.rst:2324 ../../c-api/typeobj.rst:2373 #: ../../c-api/typeobj.rst:2427 ../../c-api/typeobj.rst:2438 -#: ../../c-api/typeobj.rst:2449 ../../c-api/typeobj.rst:2458 +#: ../../c-api/typeobj.rst:2450 ../../c-api/typeobj.rst:2459 msgid "The signature of this function is::" msgstr "" @@ -3278,31 +3277,32 @@ msgstr "" #: ../../c-api/typeobj.rst:2442 msgid "" -"Must return an :term:`awaitable` object. See :meth:`__anext__` for details." +"Must return an :term:`asynchronous iterator` object. See :meth:`__anext__` " +"for details." msgstr "" -#: ../../c-api/typeobj.rst:2444 +#: ../../c-api/typeobj.rst:2445 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2453 +#: ../../c-api/typeobj.rst:2454 msgid "" "Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " "This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2462 +#: ../../c-api/typeobj.rst:2463 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2471 +#: ../../c-api/typeobj.rst:2472 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2475 +#: ../../c-api/typeobj.rst:2476 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -3316,80 +3316,80 @@ msgid "" "member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2485 +#: ../../c-api/typeobj.rst:2486 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2492 +#: ../../c-api/typeobj.rst:2493 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`\\ 。" -#: ../../c-api/typeobj.rst:2496 +#: ../../c-api/typeobj.rst:2497 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`\\ 。" -#: ../../c-api/typeobj.rst:2500 +#: ../../c-api/typeobj.rst:2501 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`\\ 。" -#: ../../c-api/typeobj.rst:2504 +#: ../../c-api/typeobj.rst:2505 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`\\ 。" -#: ../../c-api/typeobj.rst:2508 ../../c-api/typeobj.rst:2517 +#: ../../c-api/typeobj.rst:2509 ../../c-api/typeobj.rst:2518 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2512 ../../c-api/typeobj.rst:2523 +#: ../../c-api/typeobj.rst:2513 ../../c-api/typeobj.rst:2524 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2519 +#: ../../c-api/typeobj.rst:2520 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`\\ 。" -#: ../../c-api/typeobj.rst:2526 +#: ../../c-api/typeobj.rst:2527 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`\\ 。" -#: ../../c-api/typeobj.rst:2530 +#: ../../c-api/typeobj.rst:2531 msgid "See :c:member:`~PyTypeObject.tp_descrget`." msgstr "請見 :c:member:`~PyTypeObject.tp_descrget`\\ 。" -#: ../../c-api/typeobj.rst:2534 +#: ../../c-api/typeobj.rst:2535 msgid "See :c:member:`~PyTypeObject.tp_descrset`." msgstr "請見 :c:member:`~PyTypeObject.tp_descrset`\\ 。" -#: ../../c-api/typeobj.rst:2538 +#: ../../c-api/typeobj.rst:2539 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`\\ 。" -#: ../../c-api/typeobj.rst:2542 +#: ../../c-api/typeobj.rst:2543 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`\\ 。" -#: ../../c-api/typeobj.rst:2546 +#: ../../c-api/typeobj.rst:2547 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`\\ 。" -#: ../../c-api/typeobj.rst:2550 +#: ../../c-api/typeobj.rst:2551 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`\\ 。" -#: ../../c-api/typeobj.rst:2564 +#: ../../c-api/typeobj.rst:2565 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`\\ 。" -#: ../../c-api/typeobj.rst:2580 +#: ../../c-api/typeobj.rst:2581 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:2582 +#: ../../c-api/typeobj.rst:2583 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3397,33 +3397,33 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:2587 +#: ../../c-api/typeobj.rst:2588 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:2604 +#: ../../c-api/typeobj.rst:2605 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:2648 +#: ../../c-api/typeobj.rst:2649 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:2675 +#: ../../c-api/typeobj.rst:2676 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:data:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:2694 +#: ../../c-api/typeobj.rst:2695 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:2705 +#: ../../c-api/typeobj.rst:2706 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" diff --git a/c-api/unicode.po b/c-api/unicode.po index 910fc7b5fd..f1cdea95e6 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-02-24 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1208,7 +1208,7 @@ msgstr "" #: ../../c-api/unicode.rst:1011 msgid "" -"The codecs all use a similar interface. Only deviation from the following " +"The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" @@ -1359,7 +1359,7 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1154 ../../c-api/unicode.rst:1228 +#: ../../c-api/unicode.rst:1154 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." @@ -1438,6 +1438,12 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" +#: ../../c-api/unicode.rst:1228 +msgid "" +"After completion, ``*byteorder`` is set to the current byte order at the end " +"of input data." +msgstr "" + #: ../../c-api/unicode.rst:1239 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " @@ -1660,7 +1666,7 @@ msgstr "" msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " -"codecs included in the :mod:`encodings` package). The codec uses mapping to " +"codecs included in the :mod:`encodings` package). The codec uses mappings to " "encode and decode characters. The mapping objects provided must support " "the :meth:`__getitem__` mapping interface; dictionaries and sequences work " "well." @@ -1848,7 +1854,7 @@ msgstr "" #: ../../c-api/unicode.rst:1607 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " -"CRLF is considered to be one line break. If *keepend* is ``0``, the Line " +"CRLF is considered to be one line break. If *keepend* is ``0``, the line " "break characters are not included in the resulting strings." msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 89e0044d0c..c6aa0a257c 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-02-24 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,16 +98,17 @@ msgid "" "`PyRun_InteractiveLoop`, otherwise return the result of :c:func:" "`PyRun_SimpleFile`. *filename* is decoded from the filesystem encoding (:" "func:`sys.getfilesystemencoding`). If *filename* is ``NULL``, this function " -"uses ``\"???\"`` as the filename." +"uses ``\"???\"`` as the filename. If *closeit* is true, the file is closed " +"before ``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:82 +#: ../../c-api/veryhigh.rst:84 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " "leaving the :c:type:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:88 +#: ../../c-api/veryhigh.rst:90 msgid "" "Executes the Python source code from *command* in the :mod:`__main__` module " "according to the *flags* argument. If :mod:`__main__` does not already " @@ -116,26 +117,26 @@ msgid "" "information. For the meaning of *flags*, see below." msgstr "" -#: ../../c-api/veryhigh.rst:94 +#: ../../c-api/veryhigh.rst:96 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " "function will not return ``-1``, but exit the process, as long as " "``Py_InspectFlag`` is not set." msgstr "" -#: ../../c-api/veryhigh.rst:101 +#: ../../c-api/veryhigh.rst:103 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:107 +#: ../../c-api/veryhigh.rst:109 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:113 +#: ../../c-api/veryhigh.rst:115 msgid "" "Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is " "read from *fp* instead of an in-memory string. *filename* should be the name " @@ -144,20 +145,20 @@ msgid "" "``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:120 +#: ../../c-api/veryhigh.rst:122 msgid "" "On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, \"rb" "\")``). Otherwise, Python may not handle script file with LF line ending " "correctly." msgstr "" -#: ../../c-api/veryhigh.rst:126 +#: ../../c-api/veryhigh.rst:128 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:132 +#: ../../c-api/veryhigh.rst:134 msgid "" "Read and execute a single statement from a file associated with an " "interactive device according to the *flags* argument. The user will be " @@ -165,7 +166,7 @@ msgid "" "term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:137 +#: ../../c-api/veryhigh.rst:139 msgid "" "Returns ``0`` when the input was executed successfully, ``-1`` if there was " "an exception, or an error code from the :file:`errcode.h` include file " @@ -174,13 +175,13 @@ msgid "" "specifically if needed.)" msgstr "" -#: ../../c-api/veryhigh.rst:146 +#: ../../c-api/veryhigh.rst:148 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " "below, leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:152 +#: ../../c-api/veryhigh.rst:154 msgid "" "Read and execute statements from a file associated with an interactive " "device until EOF is reached. The user will be prompted using ``sys.ps1`` " @@ -188,7 +189,7 @@ msgid "" "and error handler`. Returns ``0`` at EOF or a negative number upon failure." msgstr "" -#: ../../c-api/veryhigh.rst:160 +#: ../../c-api/veryhigh.rst:162 msgid "" "Can be set to point to a function with the prototype ``int func(void)``. " "The function will be called when Python's interpreter prompt is about to " @@ -198,7 +199,7 @@ msgid "" "the Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:171 +#: ../../c-api/veryhigh.rst:173 msgid "" "Can be set to point to a function with the prototype ``char *func(FILE " "*stdin, FILE *stdout, char *prompt)``, overriding the default function used " @@ -209,26 +210,26 @@ msgid "" "line-editing and tab-completion features." msgstr "" -#: ../../c-api/veryhigh.rst:180 +#: ../../c-api/veryhigh.rst:182 msgid "" "The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:" "func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/veryhigh.rst:183 +#: ../../c-api/veryhigh.rst:185 msgid "" "The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:" "`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :" "c:func:`PyMem_Realloc`." msgstr "" -#: ../../c-api/veryhigh.rst:190 +#: ../../c-api/veryhigh.rst:192 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:196 +#: ../../c-api/veryhigh.rst:198 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " @@ -237,31 +238,31 @@ msgid "" "token that should be used to parse the source code." msgstr "" -#: ../../c-api/veryhigh.rst:202 +#: ../../c-api/veryhigh.rst:204 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." msgstr "" -#: ../../c-api/veryhigh.rst:208 +#: ../../c-api/veryhigh.rst:210 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:214 +#: ../../c-api/veryhigh.rst:216 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:220 +#: ../../c-api/veryhigh.rst:222 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:226 +#: ../../c-api/veryhigh.rst:228 msgid "" "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " "from *fp* instead of an in-memory string. *filename* should be the name of " @@ -270,19 +271,19 @@ msgid "" "`PyRun_FileExFlags` returns." msgstr "" -#: ../../c-api/veryhigh.rst:235 +#: ../../c-api/veryhigh.rst:237 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:241 +#: ../../c-api/veryhigh.rst:243 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." msgstr "" -#: ../../c-api/veryhigh.rst:247 +#: ../../c-api/veryhigh.rst:249 msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start token is given by *start*; this can be used to " @@ -293,7 +294,7 @@ msgid "" "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" -#: ../../c-api/veryhigh.rst:255 +#: ../../c-api/veryhigh.rst:257 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -302,20 +303,20 @@ msgid "" "or ``2`` (docstrings are removed too)." msgstr "" -#: ../../c-api/veryhigh.rst:266 +#: ../../c-api/veryhigh.rst:268 msgid "" "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:273 +#: ../../c-api/veryhigh.rst:275 msgid "" "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " "code object, and global and local variables. The other arguments are set to " "``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:280 +#: ../../c-api/veryhigh.rst:282 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -324,19 +325,19 @@ msgid "" "only_parameter>` arguments and a closure tuple of cells." msgstr "" -#: ../../c-api/veryhigh.rst:289 +#: ../../c-api/veryhigh.rst:291 msgid "" "The C structure of the objects used to describe frame objects. The fields of " "this type are subject to change at any time." msgstr "" -#: ../../c-api/veryhigh.rst:295 +#: ../../c-api/veryhigh.rst:297 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" -#: ../../c-api/veryhigh.rst:301 +#: ../../c-api/veryhigh.rst:303 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -346,39 +347,39 @@ msgid "" "of generator objects." msgstr "" -#: ../../c-api/veryhigh.rst:308 +#: ../../c-api/veryhigh.rst:310 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/veryhigh.rst:315 +#: ../../c-api/veryhigh.rst:317 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." msgstr "" -#: ../../c-api/veryhigh.rst:323 +#: ../../c-api/veryhigh.rst:325 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." msgstr "" -#: ../../c-api/veryhigh.rst:331 +#: ../../c-api/veryhigh.rst:333 msgid "" "The start symbol from the Python grammar for sequences of statements as read " "from a file or other source; for use with :c:func:`Py_CompileString`. This " "is the symbol to use when compiling arbitrarily long Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:340 +#: ../../c-api/veryhigh.rst:342 msgid "" "The start symbol from the Python grammar for a single statement; for use " "with :c:func:`Py_CompileString`. This is the symbol used for the interactive " "interpreter loop." msgstr "" -#: ../../c-api/veryhigh.rst:347 +#: ../../c-api/veryhigh.rst:349 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -386,34 +387,34 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: ../../c-api/veryhigh.rst:352 +#: ../../c-api/veryhigh.rst:354 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :attr:`cf_flags` is treated " "as equal to ``0``, and any modification due to ``from __future__ import`` is " "discarded." msgstr "" -#: ../../c-api/veryhigh.rst:358 +#: ../../c-api/veryhigh.rst:360 msgid "Compiler flags." msgstr "" -#: ../../c-api/veryhigh.rst:362 +#: ../../c-api/veryhigh.rst:364 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:365 +#: ../../c-api/veryhigh.rst:367 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in *cf_flags*." msgstr "" -#: ../../c-api/veryhigh.rst:368 +#: ../../c-api/veryhigh.rst:370 msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:374 +#: ../../c-api/veryhigh.rst:376 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`."